From c05d770bc77641f04f9f69cfb16c5de6a3441a61 Mon Sep 17 00:00:00 2001 From: KunfengHe <492209879@qq.com> Date: Wed, 12 Jul 2023 14:52:10 +0800 Subject: [PATCH] support for MRS & DAYU & LakeFormation --- README.md | 6 +- README_cn.md | 18 +- collector/as.go | 16 +- collector/cbr.go | 16 +- collector/dayu.go | 132 ++ collector/dcaas.go | 14 +- collector/ddos.go | 16 +- collector/dli.go | 13 +- collector/dms.go | 20 +- collector/extensions.go | 3 + collector/lakeformation.go | 101 + collector/mrs.go | 130 ++ collector/nat.go | 16 +- collector/utils.go | 38 +- collector/waf.go | 16 +- metric.yml | 33 +- vendor/github.com/cihub/seelog/LICENSE.txt | 24 - .../github.com/cihub/seelog/README.markdown | 116 - .../cihub/seelog/archive/archive.go | 198 -- .../cihub/seelog/archive/gzip/gzip.go | 64 - .../cihub/seelog/archive/tar/tar.go | 72 - .../cihub/seelog/archive/zip/zip.go | 89 - .../cihub/seelog/behavior_adaptivelogger.go | 129 -- .../cihub/seelog/behavior_asynclogger.go | 142 -- .../cihub/seelog/behavior_asynclooplogger.go | 69 - .../cihub/seelog/behavior_asynctimerlogger.go | 82 - .../cihub/seelog/behavior_synclogger.go | 75 - vendor/github.com/cihub/seelog/cfg_config.go | 212 -- vendor/github.com/cihub/seelog/cfg_errors.go | 61 - .../github.com/cihub/seelog/cfg_logconfig.go | 141 -- vendor/github.com/cihub/seelog/cfg_parser.go | 1269 ---------- .../github.com/cihub/seelog/common_closer.go | 25 - .../cihub/seelog/common_constraints.go | 162 -- .../github.com/cihub/seelog/common_context.go | 234 -- .../cihub/seelog/common_exception.go | 194 -- .../github.com/cihub/seelog/common_flusher.go | 31 - .../cihub/seelog/common_loglevel.go | 81 - .../cihub/seelog/dispatch_custom.go | 242 -- .../cihub/seelog/dispatch_dispatcher.go | 189 -- .../cihub/seelog/dispatch_filterdispatcher.go | 66 - .../cihub/seelog/dispatch_splitdispatcher.go | 47 - vendor/github.com/cihub/seelog/doc.go | 175 -- vendor/github.com/cihub/seelog/format.go | 466 ---- .../cihub/seelog/internals_baseerror.go | 10 - .../cihub/seelog/internals_fsutils.go | 320 --- .../cihub/seelog/internals_xmlnode.go | 175 -- vendor/github.com/cihub/seelog/log.go | 307 --- vendor/github.com/cihub/seelog/logger.go | 370 --- .../cihub/seelog/writers_bufferedwriter.go | 161 -- .../cihub/seelog/writers_connwriter.go | 144 -- .../cihub/seelog/writers_consolewriter.go | 47 - .../cihub/seelog/writers_filewriter.go | 92 - .../cihub/seelog/writers_formattedwriter.go | 62 - .../cihub/seelog/writers_rollingfilewriter.go | 763 ------ .../cihub/seelog/writers_smtpwriter.go | 214 -- .../lakeformation/v1/lakeFormation_client.go | 1503 ++++++++++++ .../lakeformation/v1/lakeFormation_invoker.go | 846 +++++++ .../lakeformation/v1/lakeFormation_meta.go | 2052 +++++++++++++++++ .../v1/model/model_access_info.go | 26 + .../v1/model/model_access_policy_input.go | 282 +++ .../v1/model/model_access_request_info.go | 26 + .../v1/model/model_add_partition_input.go | 26 + .../v1/model/model_add_partitions_request.go | 34 + .../v1/model/model_add_partitions_response.go | 22 + .../v1/model/model_agreement_rule.go | 32 + .../v1/model/model_alter_partition_entry.go | 24 + .../v1/model/model_alter_partitions_input.go | 23 + .../v1/model/model_alter_role_input.go | 26 + .../v1/model/model_alter_table_input.go | 24 + .../model/model_apply_for_access_request.go | 26 + .../model/model_apply_for_access_response.go | 21 + ...model_batch_authorize_interface_request.go | 25 + ...odel_batch_authorize_interface_response.go | 26 + ..._cancel_authorization_interface_request.go | 25 + ...cancel_authorization_interface_response.go | 21 + .../model_batch_create_constraint_request.go | 34 + .../model_batch_create_constraint_response.go | 21 + .../model_batch_delete_partition_request.go | 34 + .../model_batch_delete_partition_response.go | 22 + ...h_delete_partitioned_statistics_request.go | 34 + ..._delete_partitioned_statistics_response.go | 21 + ..._batch_list_partition_by_values_request.go | 34 + ...batch_list_partition_by_values_response.go | 22 + ...how_partition_column_statistics_request.go | 34 + ...ow_partition_column_statistics_response.go | 27 + ...te_lake_formation_instance_tags_request.go | 25 + ...e_lake_formation_instance_tags_response.go | 21 + .../model_batch_update_partition_request.go | 34 + .../model_batch_update_partition_response.go | 22 + .../model_batch_update_tags_request_body.go | 22 + .../model_binary_column_statistics_data.go | 28 + .../model_boolean_column_statistics_data.go | 28 + .../v1/model/model_bucket_detail.go | 33 + .../lakeformation/v1/model/model_catalog.go | 32 + .../v1/model/model_catalog_info.go | 26 + .../v1/model/model_catalog_input.go | 32 + .../v1/model/model_check_constraint.go | 46 + .../v1/model/model_check_constraint_input.go | 37 + .../lakeformation/v1/model/model_column.go | 29 + .../v1/model/model_column_info.go | 71 + .../v1/model/model_column_statistics_obj.go | 107 + .../v1/model/model_count_meta_obj_request.go | 23 + .../v1/model/model_count_meta_obj_response.go | 42 + .../model/model_create_agreement_request.go | 21 + .../model/model_create_agreement_response.go | 22 + .../v1/model/model_create_catalog_request.go | 25 + .../v1/model/model_create_catalog_response.go | 33 + .../v1/model/model_create_database_request.go | 28 + .../model/model_create_database_response.go | 97 + .../v1/model/model_create_function_request.go | 31 + .../model/model_create_function_response.go | 134 ++ .../model_create_instance_request_body.go | 82 + ..._create_lake_formation_instance_request.go | 21 + ...create_lake_formation_instance_response.go | 57 + .../v1/model/model_create_role_request.go | 25 + .../v1/model/model_create_role_response.go | 87 + .../v1/model/model_create_spec.go | 25 + .../v1/model/model_create_table_request.go | 31 + .../v1/model/model_create_table_response.go | 169 ++ .../v1/model/model_data_mask_policy_item.go | 39 + .../lakeformation/v1/model/model_database.go | 96 + .../v1/model/model_database_info.go | 29 + .../v1/model/model_database_input.go | 93 + .../model_date_column_statistics_data.go | 35 + .../lakeformation/v1/model/model_decimal.go | 25 + .../model_decimal_column_statistics_data.go | 32 + .../v1/model/model_default_constraint.go | 46 + .../model/model_default_constraint_input.go | 37 + .../model/model_delete_all_tables_request.go | 32 + .../model/model_delete_all_tables_response.go | 21 + .../v1/model/model_delete_catalog_request.go | 26 + .../v1/model/model_delete_catalog_response.go | 21 + .../model/model_delete_constraint_request.go | 35 + .../model/model_delete_constraint_response.go | 21 + .../v1/model/model_delete_database_request.go | 35 + .../model/model_delete_database_response.go | 21 + .../v1/model/model_delete_function_request.go | 32 + .../model/model_delete_function_response.go | 21 + ..._delete_lake_formation_instance_request.go | 26 + ...delete_lake_formation_instance_response.go | 22 + ...ete_partition_column_statistics_request.go | 38 + ...te_partition_column_statistics_response.go | 21 + .../v1/model/model_delete_role_request.go | 26 + .../v1/model/model_delete_role_response.go | 21 + ..._delete_table_column_statistics_request.go | 35 + ...delete_table_column_statistics_response.go | 21 + .../v1/model/model_delete_table_request.go | 35 + .../v1/model/model_delete_table_response.go | 21 + .../model_double_column_statistics_data.go | 35 + .../v1/model/model_drop_partitions_input.go | 29 + .../v1/model/model_foreign_key.go | 64 + .../v1/model/model_foreign_key_input.go | 55 + .../lakeformation/v1/model/model_function.go | 133 ++ .../v1/model/model_function_info.go | 23 + .../v1/model/model_function_input.go | 127 + .../v1/model/model_function_resource_uri.go | 75 + ...l_get_partition_column_statistics_input.go | 29 + .../model_get_partitions_by_values_input.go | 22 + ...model_get_table_column_statistics_input.go | 23 + .../v1/model/model_lake_formation_instance.go | 48 + .../v1/model/model_lake_formation_policy.go | 405 ++++ .../model/model_list_access_infos_request.go | 29 + .../model/model_list_access_infos_response.go | 27 + .../model/model_list_all_functions_request.go | 35 + .../model_list_all_functions_response.go | 24 + .../v1/model/model_list_catalogs_request.go | 23 + .../v1/model/model_list_catalogs_response.go | 22 + .../model/model_list_constraints_request.go | 102 + .../model/model_list_constraints_response.go | 103 + .../model_list_database_names_request.go | 29 + .../model_list_database_names_response.go | 22 + .../v1/model/model_list_databases_request.go | 38 + .../v1/model/model_list_databases_response.go | 24 + .../v1/model/model_list_functions_request.go | 41 + .../v1/model/model_list_functions_response.go | 24 + .../model_list_groups_for_domain_request.go | 88 + .../model_list_groups_for_domain_response.go | 24 + .../v1/model/model_list_interfaces_request.go | 216 ++ .../model/model_list_interfaces_response.go | 26 + ...l_list_lake_formation_instances_request.go | 38 + ..._list_lake_formation_instances_response.go | 29 + .../model/model_list_obs_buckets_request.go | 26 + .../model/model_list_obs_buckets_response.go | 29 + .../v1/model/model_list_obs_object_request.go | 32 + .../model/model_list_obs_object_response.go | 36 + .../model_list_partition_names_request.go | 44 + .../model_list_partition_names_response.go | 26 + .../v1/model/model_list_partitions_request.go | 47 + .../model/model_list_partitions_response.go | 24 + .../v1/model/model_list_policy_request.go | 32 + .../v1/model/model_list_policy_response.go | 25 + .../v1/model/model_list_role_names_request.go | 23 + .../model/model_list_role_names_response.go | 22 + .../v1/model/model_list_roles_request.go | 35 + .../v1/model/model_list_roles_response.go | 24 + .../v1/model/model_list_specs_request.go | 29 + .../v1/model/model_list_specs_response.go | 27 + .../model/model_list_table_by_name_input.go | 23 + ...el_list_table_column_statistics_request.go | 34 + ...l_list_table_column_statistics_response.go | 22 + .../v1/model/model_list_table_meta_request.go | 97 + .../model/model_list_table_meta_response.go | 24 + .../model/model_list_table_names_request.go | 35 + .../model/model_list_table_names_response.go | 22 + .../model_list_tables_by_name_request.go | 31 + .../model_list_tables_by_name_response.go | 22 + .../v1/model/model_list_tables_request.go | 100 + .../v1/model/model_list_tables_response.go | 24 + .../model_long_column_statistics_data.go | 34 + ...odel_merge_table_column_statistic_input.go | 24 + ...mation_instance_out_recycle_bin_request.go | 23 + ...ation_instance_out_recycle_bin_response.go | 22 + .../v1/model/model_not_null_constraint.go | 43 + .../model/model_not_null_constraint_input.go | 34 + .../lakeformation/v1/model/model_order.go | 26 + .../v1/model/model_paged_info.go | 29 + .../lakeformation/v1/model/model_partition.go | 44 + .../model_partition_column_statistics.go | 24 + ...partition_column_statistics_description.go | 27 + .../v1/model/model_partition_input.go | 35 + .../lakeformation/v1/model/model_policy.go | 110 + .../v1/model/model_policy_delta.go | 20 + .../v1/model/model_policy_item.go | 37 + .../v1/model/model_policy_item_access.go | 25 + .../v1/model/model_policy_item_condition.go | 25 + .../model/model_policy_item_data_mask_info.go | 28 + .../model_policy_item_row_filter_info.go | 22 + .../v1/model/model_policy_resource.go | 28 + .../v1/model/model_primary_key.go | 47 + .../v1/model/model_primary_key_input.go | 38 + .../lakeformation/v1/model/model_principal.go | 135 ++ .../v1/model/model_recurrence_schedule.go | 37 + .../v1/model/model_resource_info.go | 94 + .../v1/model/model_resource_tag.go | 26 + .../lakeformation/v1/model/model_role.go | 86 + .../v1/model/model_role_input.go | 26 + .../v1/model/model_row_filter_policy_item.go | 39 + .../v1/model/model_ser_de_info.go | 29 + ...l_set_partition_column_statistics_input.go | 26 + ...set_partition_column_statistics_request.go | 34 + ...et_partition_column_statistics_response.go | 21 + ...del_set_table_column_statistics_request.go | 34 + ...el_set_table_column_statistics_response.go | 25 + .../v1/model/model_show_agreement_request.go | 20 + .../v1/model/model_show_agreement_response.go | 29 + .../model_show_agreement_rule_request.go | 20 + .../model_show_agreement_rule_response.go | 26 + .../v1/model/model_show_catalog_request.go | 26 + .../v1/model/model_show_catalog_response.go | 33 + .../v1/model/model_show_database_request.go | 29 + .../v1/model/model_show_database_response.go | 97 + .../v1/model/model_show_function_request.go | 32 + .../v1/model/model_show_function_response.go | 134 ++ ...el_show_lake_formation_instance_request.go | 23 + ...l_show_lake_formation_instance_response.go | 57 + .../v1/model/model_show_role_request.go | 26 + .../v1/model/model_show_role_response.go | 25 + .../model/model_show_sync_policy_request.go | 32 + .../model/model_show_sync_policy_response.go | 33 + .../v1/model/model_show_table_request.go | 32 + .../v1/model/model_show_table_response.go | 169 ++ .../v1/model/model_skewed_info.go | 28 + .../lakeformation/v1/model/model_spec.go | 47 + .../v1/model/model_storage_descriptor.go | 53 + .../model_string_column_statistics_data.go | 34 + .../lakeformation/v1/model/model_table.go | 168 ++ .../v1/model/model_table_column_statistics.go | 24 + ...del_table_column_statistics_description.go | 24 + .../v1/model/model_table_constraints_input.go | 102 + .../v1/model/model_table_info.go | 24 + .../v1/model/model_table_input.go | 159 ++ .../v1/model/model_table_meta.go | 88 + .../v1/model/model_tenant_agreement.go | 26 + .../v1/model/model_tenant_agreement_body.go | 23 + .../model/model_truncate_partition_input.go | 23 + .../v1/model/model_unique_constraint.go | 46 + .../v1/model/model_unique_constraint_input.go | 37 + .../v1/model/model_update_catalog_request.go | 28 + .../v1/model/model_update_catalog_response.go | 33 + .../v1/model/model_update_database_request.go | 31 + .../model/model_update_database_response.go | 97 + .../v1/model/model_update_function_request.go | 34 + .../model/model_update_function_response.go | 134 ++ .../model_update_lake_formation_instance.go | 26 + ..._update_lake_formation_instance_request.go | 25 + ...update_lake_formation_instance_response.go | 49 + .../v1/model/model_update_role_request.go | 28 + .../v1/model/model_update_role_response.go | 87 + .../v1/model/model_update_table_request.go | 34 + .../v1/model/model_update_table_response.go | 169 ++ .../v1/model/model_user_group.go | 86 + .../lakeformation/v1/model/model_user_role.go | 128 + .../v1/model/model_validity_interval.go | 28 + .../v1/model/model_validity_recurrence.go | 22 + .../v1/model/model_validity_schedule.go | 31 + .../mrs/v1/model/model_add_jobs_req_v11.go | 55 + .../mrs/v1/model/model_auto_scaling_policy.go | 37 + .../model_auto_scaling_policy_req_v11.go | 65 + .../model_batch_create_cluster_tags_req.go | 66 + ...model_batch_create_cluster_tags_request.go | 25 + ...odel_batch_create_cluster_tags_response.go | 21 + .../model_batch_delete_cluster_tags_req.go | 66 + ...model_batch_delete_cluster_tags_request.go | 25 + ...odel_batch_delete_cluster_tags_response.go | 21 + .../mrs/v1/model/model_bootstrap_script.go | 202 ++ .../services/mrs/v1/model/model_cluster.go | 214 ++ .../v1/model/model_cluster_scaling_params.go | 90 + .../mrs/v1/model/model_cluster_scaling_req.go | 30 + .../mrs/v1/model/model_component_amb.go | 31 + .../mrs/v1/model/model_component_amb_v11.go | 22 + .../model_create_and_execute_job_request.go | 21 + .../model_create_and_execute_job_response.go | 150 ++ .../v1/model/model_create_cluster_req_v11.go | 520 +++++ .../v1/model/model_create_cluster_request.go | 21 + .../v1/model/model_create_cluster_response.go | 30 + .../model/model_create_cluster_tag_request.go | 25 + .../model_create_cluster_tag_response.go | 21 + .../model_create_scaling_policy_request.go | 25 + .../model_create_scaling_policy_response.go | 22 + .../mrs/v1/model/model_create_tag_req.go | 20 + .../v1/model/model_delete_cluster_request.go | 23 + .../v1/model/model_delete_cluster_response.go | 22 + .../model/model_delete_cluster_tag_request.go | 26 + .../model_delete_cluster_tag_response.go | 21 + .../model_delete_job_execution_request.go | 23 + .../model_delete_job_execution_response.go | 21 + .../services/mrs/v1/model/model_host_model.go | 64 + .../mrs/v1/model/model_job_exe_result.go | 118 + .../v1/model/model_list_all_tags_request.go | 20 + .../v1/model/model_list_all_tags_response.go | 24 + .../model/model_list_cluster_tags_request.go | 23 + .../model/model_list_cluster_tags_response.go | 24 + .../model_list_clusters_by_tags_request.go | 21 + .../model_list_clusters_by_tags_response.go | 27 + .../v1/model/model_list_clusters_request.go | 38 + .../v1/model/model_list_clusters_response.go | 27 + .../model/model_list_execute_job_request.go | 38 + .../model/model_list_execute_job_response.go | 27 + .../mrs/v1/model/model_list_hosts_request.go | 29 + .../mrs/v1/model/model_list_hosts_response.go | 27 + .../mrs/v1/model/model_list_resource_req.go | 88 + .../services/mrs/v1/model/model_match.go | 25 + .../mrs/v1/model/model_mrs_resource.go | 31 + .../mrs/v1/model/model_node_group_v10.go | 126 + .../mrs/v1/model/model_node_group_v11.go | 45 + .../mrs/v1/model/model_resources_plan.go | 34 + .../services/mrs/v1/model/model_rule.go | 81 + .../mrs/v1/model/model_scale_script.go | 135 ++ .../model_show_cluster_details_request.go | 23 + .../model_show_cluster_details_response.go | 22 + .../v1/model/model_show_job_exes_request.go | 23 + .../v1/model/model_show_job_exes_response.go | 22 + .../mrs/v1/model/model_submit_job_req_v11.go | 52 + .../services/mrs/v1/model/model_tag.go | 25 + .../services/mrs/v1/model/model_tag_plain.go | 25 + .../v1/model/model_tag_with_multi_value.go | 25 + .../mrs/v1/model/model_task_node_group.go | 89 + .../mrs/v1/model/model_task_node_info.go | 84 + .../services/mrs/v1/model/model_trigger.go | 31 + .../model_update_cluster_scaling_request.go | 25 + .../model_update_cluster_scaling_response.go | 24 + .../services/mrs/v1/mrs_client.go | 436 ++++ .../services/mrs/v1/mrs_invoker.go | 222 ++ .../services/mrs/v1/mrs_meta.go | 369 +++ vendor/modules.txt | 4 + 365 files changed, 19999 insertions(+), 7448 deletions(-) create mode 100644 collector/dayu.go create mode 100644 collector/lakeformation.go create mode 100644 collector/mrs.go delete mode 100644 vendor/github.com/cihub/seelog/LICENSE.txt delete mode 100644 vendor/github.com/cihub/seelog/README.markdown delete mode 100644 vendor/github.com/cihub/seelog/archive/archive.go delete mode 100644 vendor/github.com/cihub/seelog/archive/gzip/gzip.go delete mode 100644 vendor/github.com/cihub/seelog/archive/tar/tar.go delete mode 100644 vendor/github.com/cihub/seelog/archive/zip/zip.go delete mode 100644 vendor/github.com/cihub/seelog/behavior_adaptivelogger.go delete mode 100644 vendor/github.com/cihub/seelog/behavior_asynclogger.go delete mode 100644 vendor/github.com/cihub/seelog/behavior_asynclooplogger.go delete mode 100644 vendor/github.com/cihub/seelog/behavior_asynctimerlogger.go delete mode 100644 vendor/github.com/cihub/seelog/behavior_synclogger.go delete mode 100644 vendor/github.com/cihub/seelog/cfg_config.go delete mode 100644 vendor/github.com/cihub/seelog/cfg_errors.go delete mode 100644 vendor/github.com/cihub/seelog/cfg_logconfig.go delete mode 100644 vendor/github.com/cihub/seelog/cfg_parser.go delete mode 100644 vendor/github.com/cihub/seelog/common_closer.go delete mode 100644 vendor/github.com/cihub/seelog/common_constraints.go delete mode 100644 vendor/github.com/cihub/seelog/common_context.go delete mode 100644 vendor/github.com/cihub/seelog/common_exception.go delete mode 100644 vendor/github.com/cihub/seelog/common_flusher.go delete mode 100644 vendor/github.com/cihub/seelog/common_loglevel.go delete mode 100644 vendor/github.com/cihub/seelog/dispatch_custom.go delete mode 100644 vendor/github.com/cihub/seelog/dispatch_dispatcher.go delete mode 100644 vendor/github.com/cihub/seelog/dispatch_filterdispatcher.go delete mode 100644 vendor/github.com/cihub/seelog/dispatch_splitdispatcher.go delete mode 100644 vendor/github.com/cihub/seelog/doc.go delete mode 100644 vendor/github.com/cihub/seelog/format.go delete mode 100644 vendor/github.com/cihub/seelog/internals_baseerror.go delete mode 100644 vendor/github.com/cihub/seelog/internals_fsutils.go delete mode 100644 vendor/github.com/cihub/seelog/internals_xmlnode.go delete mode 100644 vendor/github.com/cihub/seelog/log.go delete mode 100644 vendor/github.com/cihub/seelog/logger.go delete mode 100644 vendor/github.com/cihub/seelog/writers_bufferedwriter.go delete mode 100644 vendor/github.com/cihub/seelog/writers_connwriter.go delete mode 100644 vendor/github.com/cihub/seelog/writers_consolewriter.go delete mode 100644 vendor/github.com/cihub/seelog/writers_filewriter.go delete mode 100644 vendor/github.com/cihub/seelog/writers_formattedwriter.go delete mode 100644 vendor/github.com/cihub/seelog/writers_rollingfilewriter.go delete mode 100644 vendor/github.com/cihub/seelog/writers_smtpwriter.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/lakeFormation_client.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/lakeFormation_invoker.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/lakeFormation_meta.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_access_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_access_policy_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_access_request_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_add_partition_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_add_partitions_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_add_partitions_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_agreement_rule.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_partition_entry.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_partitions_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_role_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_table_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_apply_for_access_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_apply_for_access_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_authorize_interface_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_authorize_interface_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_cancel_authorization_interface_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_cancel_authorization_interface_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_create_constraint_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_create_constraint_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partition_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partition_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partitioned_statistics_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partitioned_statistics_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_list_partition_by_values_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_list_partition_by_values_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_show_partition_column_statistics_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_show_partition_column_statistics_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_lake_formation_instance_tags_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_lake_formation_instance_tags_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_partition_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_partition_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_tags_request_body.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_binary_column_statistics_data.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_boolean_column_statistics_data.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_bucket_detail.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_catalog.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_catalog_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_catalog_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_check_constraint.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_check_constraint_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_column.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_column_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_column_statistics_obj.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_count_meta_obj_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_count_meta_obj_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_agreement_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_agreement_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_catalog_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_catalog_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_database_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_database_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_function_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_function_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_instance_request_body.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_lake_formation_instance_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_lake_formation_instance_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_role_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_role_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_spec.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_table_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_table_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_data_mask_policy_item.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_database.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_database_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_database_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_date_column_statistics_data.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_decimal.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_decimal_column_statistics_data.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_default_constraint.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_default_constraint_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_all_tables_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_all_tables_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_catalog_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_catalog_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_constraint_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_constraint_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_database_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_database_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_function_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_function_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_lake_formation_instance_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_lake_formation_instance_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_partition_column_statistics_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_partition_column_statistics_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_role_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_role_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_column_statistics_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_column_statistics_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_double_column_statistics_data.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_drop_partitions_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_foreign_key.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_foreign_key_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function_resource_uri.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_get_partition_column_statistics_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_get_partitions_by_values_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_get_table_column_statistics_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_lake_formation_instance.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_lake_formation_policy.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_access_infos_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_access_infos_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_all_functions_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_all_functions_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_catalogs_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_catalogs_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_constraints_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_constraints_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_database_names_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_database_names_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_databases_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_databases_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_functions_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_functions_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_groups_for_domain_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_groups_for_domain_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_interfaces_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_interfaces_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_lake_formation_instances_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_lake_formation_instances_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_buckets_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_buckets_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_object_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_object_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partition_names_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partition_names_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partitions_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partitions_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_policy_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_policy_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_role_names_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_role_names_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_roles_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_roles_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_specs_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_specs_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_by_name_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_column_statistics_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_column_statistics_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_meta_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_meta_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_names_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_names_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_by_name_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_by_name_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_long_column_statistics_data.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_merge_table_column_statistic_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_move_lake_formation_instance_out_recycle_bin_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_move_lake_formation_instance_out_recycle_bin_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_not_null_constraint.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_not_null_constraint_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_order.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_paged_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition_column_statistics.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition_column_statistics_description.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_delta.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_access.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_condition.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_data_mask_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_row_filter_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_resource.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_primary_key.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_primary_key_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_principal.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_recurrence_schedule.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_resource_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_resource_tag.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_role.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_role_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_row_filter_policy_item.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_ser_de_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_partition_column_statistics_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_partition_column_statistics_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_partition_column_statistics_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_table_column_statistics_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_table_column_statistics_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_rule_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_rule_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_catalog_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_catalog_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_database_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_database_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_function_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_function_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_lake_formation_instance_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_lake_formation_instance_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_role_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_role_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_sync_policy_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_sync_policy_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_table_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_table_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_skewed_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_spec.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_storage_descriptor.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_string_column_statistics_data.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_column_statistics.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_column_statistics_description.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_constraints_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_meta.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_tenant_agreement.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_tenant_agreement_body.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_truncate_partition_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_unique_constraint.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_unique_constraint_input.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_catalog_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_catalog_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_database_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_database_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_function_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_function_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_lake_formation_instance.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_lake_formation_instance_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_lake_formation_instance_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_role_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_role_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_table_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_table_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_user_group.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_user_role.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_validity_interval.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_validity_recurrence.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_validity_schedule.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_add_jobs_req_v11.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_auto_scaling_policy.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_auto_scaling_policy_req_v11.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_create_cluster_tags_req.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_create_cluster_tags_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_create_cluster_tags_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_delete_cluster_tags_req.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_delete_cluster_tags_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_delete_cluster_tags_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_bootstrap_script.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_cluster.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_cluster_scaling_params.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_cluster_scaling_req.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_component_amb.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_component_amb_v11.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_and_execute_job_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_and_execute_job_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_req_v11.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_tag_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_tag_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_scaling_policy_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_scaling_policy_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_tag_req.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_tag_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_tag_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_job_execution_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_job_execution_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_host_model.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_job_exe_result.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_all_tags_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_all_tags_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_cluster_tags_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_cluster_tags_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_by_tags_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_by_tags_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_execute_job_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_execute_job_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_hosts_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_hosts_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_resource_req.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_match.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_mrs_resource.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_node_group_v10.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_node_group_v11.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_resources_plan.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_rule.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_scale_script.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_cluster_details_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_cluster_details_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_job_exes_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_job_exes_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_submit_job_req_v11.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_tag.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_tag_plain.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_tag_with_multi_value.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_task_node_group.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_task_node_info.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_trigger.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_update_cluster_scaling_request.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_update_cluster_scaling_response.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/mrs_client.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/mrs_invoker.go create mode 100644 vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/mrs_meta.go diff --git a/README.md b/README.md index 80dedefe..d6b53b94 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Prometheus cloudeye exporter for [Huaweicloud](https://www.huaweicloud.com/). +Note: The plug-in is applicable only to the Huaweicloud regions. + [中文](./README_cn.md) ## Download @@ -39,7 +41,7 @@ Usage of ./cloudeye-exporter: ``` ## Example of config file(clouds.yml) -The "URL" value can be get from [Identity and Access Management (IAM) endpoint list](https://developer.huaweicloud.com/en-us/endpoint). +The "URL" value can be get from [Identity and Access Management (IAM) endpoint list](https://developer.huaweicloud.com/endpoint?IAM). ``` global: prefix: "huaweicloud" @@ -48,7 +50,7 @@ global: scrape_batch_size: 300 auth: - auth_url: "https://iam.xxx.yyy.com/v3" + auth_url: "https://iam.{region_id}.myhuaweicloud.com/v3" project_name: "{project_name}" access_key: "{access_key}" secret_key: "{secret_key}" diff --git a/README_cn.md b/README_cn.md index b9a45d0a..a773f08a 100644 --- a/README_cn.md +++ b/README_cn.md @@ -3,6 +3,7 @@ [华为云](https://www.huaweicloud.com/)云监控的 Prometheus Exporter. +注意:该插件仅适用于华为云局点。 ## 介绍 Prometheus是用于展示大型测量数据的开源可视化工具,在工业监控、气象监控、家居自动化和过程管理等领域也有着较广泛的用户基础。将华为云Cloudeye服务接入 prometheus后,您可以利用 prometheus更好地监控和分析来自 Cloudeye服务的数据。 @@ -46,6 +47,9 @@ Prometheus是用于展示大型测量数据的开源可视化工具,在工业 |VPC终端节点|SYS.VPCEP |√|RMS| |图引擎服务GES|SYS.GES|√|RMS| |数据库安全服务DBSS|SYS.DBSS |√|RMS| +|MapReduce服务|SYS.MRS |√|RMS/云服务| +|湖仓构建服务|SYS.LakeFormation |√|RMS/云服务| +|智能数据湖运营平台|SYS.DAYU |√|云服务| 注:自定义标签时,key只能包含大写字母、小写字母以及中划线 @@ -64,8 +68,8 @@ Prometheus是用于展示大型测量数据的开源可视化工具,在工业 # 参考命令: mkdir cloudeye-exporter cd cloudeye-exporter -wget https://github.com/huaweicloud/cloudeye-exporter/releases/download/v2.0.4/cloudeye-exporter.v2.0.4.tar.gz -tar -xzvf cloudeye-exporter.v2.0.4.tar.gz +wget https://github.com/huaweicloud/cloudeye-exporter/releases/download/v2.0.5/cloudeye-exporter.v2.0.5.tar.gz +tar -xzvf cloudeye-exporter.v2.0.5.tar.gz ``` 2. 编辑clouds.yml文件配置公有云信息 ``` @@ -73,11 +77,11 @@ global: port: ":8087" scrape_batch_size: 300 auth: -auth_url: "https://iam.cn-north-1.myhuaweicloud.com/v3" -project_name: "cn-north-1" -access_key: "" -secret_key: "" -region: "cn-north-1" + auth_url: "https://iam.{region_id}.myhuaweicloud.com/v3" + project_name: "cn-north-1" + access_key: "" + secret_key: "" + region: "cn-north-1" ``` 注:默认的监控端口为8087. diff --git a/collector/as.go b/collector/as.go index 596f5861..28f13c00 100644 --- a/collector/as.go +++ b/collector/as.go @@ -4,8 +4,6 @@ import ( "time" cesmodel "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ces/v1/model" - - "github.com/huaweicloud/cloudeye-exporter/logs" ) var asInfo serversInfo @@ -42,17 +40,5 @@ func (getter ASInfo) GetResourceInfo() (map[string]labelInfo, []cesmodel.MetricI } func getAllASFromRMS() ([]ResourceBaseInfo, error) { - resp, err := listResources("as", "scalingGroups") - if err != nil { - logs.Logger.Errorf("Failed to list resource of as.scalingGroups, error: %s", err.Error()) - return nil, err - } - scalingGroups := make([]ResourceBaseInfo, len(resp)) - for index, resource := range resp { - scalingGroups[index].ID = *resource.Id - scalingGroups[index].Name = *resource.Name - scalingGroups[index].EpId = *resource.EpId - scalingGroups[index].Tags = resource.Tags - } - return scalingGroups, nil + return getResourcesBaseInfoFromRMS("as", "scalingGroups") } diff --git a/collector/cbr.go b/collector/cbr.go index db3d2adf..0603b578 100644 --- a/collector/cbr.go +++ b/collector/cbr.go @@ -57,21 +57,7 @@ func (getter CBRInfo) GetResourceInfo() (map[string]labelInfo, []model.MetricInf } func getAllCbrInstancesFromRMS() ([]ResourceBaseInfo, error) { - resp, err := listResources("cbr", "vault") - if err != nil { - logs.Logger.Errorf("Failed to list resource of cbr.vault, error: %s", err.Error()) - return nil, err - } - cbrInstances := make([]ResourceBaseInfo, 0, len(resp)) - for _, resource := range resp { - cbrInstances = append(cbrInstances, ResourceBaseInfo{ - ID: *resource.Id, - Name: *resource.Name, - EpId: *resource.EpId, - Tags: resource.Tags, - }) - } - return cbrInstances, nil + return getResourcesBaseInfoFromRMS("cbr", "vault") } func getAllCbrInstancesFromCBR() ([]ResourceBaseInfo, error) { diff --git a/collector/dayu.go b/collector/dayu.go new file mode 100644 index 00000000..88e97230 --- /dev/null +++ b/collector/dayu.go @@ -0,0 +1,132 @@ +package collector + +import ( + "errors" + "net/http" + "time" + + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/def" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ces/v1/model" + + "github.com/huaweicloud/cloudeye-exporter/logs" +) + +var dayuInfo serversInfo + +type DayuInfo struct{} + +func (getter DayuInfo) GetResourceInfo() (map[string]labelInfo, []model.MetricInfoList) { + resourceInfos := map[string]labelInfo{} + filterMetrics := make([]model.MetricInfoList, 0) + dayuInfo.Lock() + defer dayuInfo.Unlock() + if dayuInfo.LabelInfo == nil || time.Now().Unix() > dayuInfo.TTL { + streams, err := getAllStreams() + if err != nil { + logs.Logger.Error("Get all dis Streams error:", err.Error()) + return dayuInfo.LabelInfo, dayuInfo.FilterMetrics + } + + sysConfigMap := getMetricConfigMap("SYS.DAYU") + for _, stream := range streams { + if metricNames, ok := sysConfigMap["stream_id"]; ok { + metrics := buildSingleDimensionMetrics(metricNames, "SYS.DAYU", "stream_id", stream.ID) + filterMetrics = append(filterMetrics, metrics...) + info := labelInfo{ + Name: []string{"name", "epId"}, + Value: []string{stream.Name, stream.EpId}, + } + keys, values := getTags(stream.Tags) + info.Name = append(info.Name, keys...) + info.Value = append(info.Value, values...) + resourceInfos[GetResourceKeyFromMetricInfo(metrics[0])] = info + } + } + + dayuInfo.LabelInfo = resourceInfos + dayuInfo.FilterMetrics = filterMetrics + dayuInfo.TTL = time.Now().Add(TTL).Unix() + } + return dayuInfo.LabelInfo, dayuInfo.FilterMetrics +} + +type StreamInfo struct { + Private bool `json:"private"` + StreamID string `json:"stream_id"` + StreamName string `json:"stream_name"` + CreateTime int64 `json:"create_time"` + RetentionPeriod int `json:"retention_period"` + Status string `json:"status"` + StreamType string `json:"stream_type"` + DataType string `json:"data_type"` + PartitionCount int `json:"partition_count"` + Tags []Tag `json:"tags"` + SysTags []Tag `json:"sys_tags"` + AutoScaleEnabled bool `json:"auto_scale_enabled"` + AutoScaleMinPartitionCount int `json:"auto_scale_min_partition_count"` + AutoScaleMaxPartitionCount int `json:"auto_scale_max_partition_count"` +} + +type ListStreamsResp struct { + TotalNumber int `json:"total_number"` + StreamNames []string `json:"stream_names"` + StreamInfoList []StreamInfo `json:"stream_info_list"` + HasMoreStreams bool `json:"has_more_streams"` + HttpStatusCode int `json:"-"` +} + +type ListStreamsRep struct { + Limit string `json:"limit"` + StartStreamName string `json:"start_stream_name"` +} + +func genReqDefForListStreams() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder().WithMethod(http.MethodGet).WithPath("/v2/{project_id}/streams"). + WithResponse(new(ListStreamsResp)).WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef().WithName("Limit").WithJsonTag("limit").WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef().WithName("StartStreamName").WithJsonTag("start_stream_name").WithLocationType(def.Query)) + return reqDefBuilder.Build() +} + +func listStreams() ([]StreamInfo, error) { + disClient := getHcClient(getEndpoint("dis", "v2")) + request := &ListStreamsRep{Limit: "100"} + var streams []StreamInfo + for { + resp, err := disClient.Sync(request, genReqDefForListStreams()) + if err != nil { + logs.Logger.Errorf("Failed to get list streams : %s", err.Error()) + return nil, err + } + response, ok := resp.(*ListStreamsResp) + if !ok { + err := errors.New("resp type is not ServiceDetail") + logs.Logger.Errorf("Failed to get list streams : %s", err.Error()) + return nil, err + } + streams = append(streams, response.StreamInfoList...) + if !response.HasMoreStreams { + break + } + request.StartStreamName = response.StreamNames[len(response.StreamNames)-1] + } + return streams, nil +} + +func getAllStreams() ([]ResourceBaseInfo, error) { + streams, err := listStreams() + if err != nil { + logs.Logger.Errorf("Failed to get list streams : %s", err.Error()) + return nil, err + } + + resources := make([]ResourceBaseInfo, len(streams)) + for i, stream := range streams { + resources[i].ID = stream.StreamID + resources[i].Name = stream.StreamName + resources[i].EpId = fmtTags(stream.SysTags)["_sys_enterprise_project_id"] + resources[i].Tags = fmtTags(stream.Tags) + } + return resources, nil +} diff --git a/collector/dcaas.go b/collector/dcaas.go index c407bdb1..79b5db48 100644 --- a/collector/dcaas.go +++ b/collector/dcaas.go @@ -182,17 +182,5 @@ func getDcaasVifFromRMS() ([]VifInfo, error) { } func getDcaasVgwFromRMS() ([]ResourceBaseInfo, error) { - resp, err := listResources("dcaas", "vgw") - if err != nil { - logs.Logger.Errorf("Failed to list resource of dcaas.vgw, error: %s", err.Error()) - return nil, err - } - vgws := make([]ResourceBaseInfo, len(resp)) - for index, resource := range resp { - vgws[index].ID = *resource.Id - vgws[index].Name = *resource.Name - vgws[index].EpId = *resource.EpId - vgws[index].Tags = resource.Tags - } - return vgws, nil + return getResourcesBaseInfoFromRMS("dcaas", "vgw") } diff --git a/collector/ddos.go b/collector/ddos.go index 29d32326..a0782804 100644 --- a/collector/ddos.go +++ b/collector/ddos.go @@ -46,19 +46,5 @@ func (getter DDOSInfo) GetResourceInfo() (map[string]labelInfo, []model.MetricIn } func getAllDDosInstancesFromRMS() ([]ResourceBaseInfo, error) { - resp, err := listResources("aad", "instances") - if err != nil { - logs.Logger.Errorf("Failed to list resource of aad.instances, error: %s", err.Error()) - return nil, err - } - instances := make([]ResourceBaseInfo, 0, len(resp)) - for _, resource := range resp { - instances = append(instances, ResourceBaseInfo{ - ID: *resource.Id, - Name: *resource.Name, - EpId: *resource.EpId, - Tags: resource.Tags, - }) - } - return instances, nil + return getResourcesBaseInfoFromRMS("aad", "instances") } diff --git a/collector/dli.go b/collector/dli.go index 225f21b9..a53c3c00 100644 --- a/collector/dli.go +++ b/collector/dli.go @@ -85,18 +85,7 @@ func buildFlinkJobsInfo(sysConfigMap map[string][]string, filterMetrics *[]model } func getQueuesFromRMS() ([]ResourceBaseInfo, error) { - resp, err := listResources("dli", "queues") - if err != nil { - return nil, err - } - instances := make([]ResourceBaseInfo, len(resp)) - for index, resource := range resp { - instances[index].ID = *resource.Id - instances[index].Name = *resource.Name - instances[index].EpId = *resource.EpId - instances[index].Tags = resource.Tags - } - return instances, nil + return getResourcesBaseInfoFromRMS("dli", "queues") } type ListFlinkJobsRequest struct { diff --git a/collector/dms.go b/collector/dms.go index e527eead..69a76221 100644 --- a/collector/dms.go +++ b/collector/dms.go @@ -6,7 +6,6 @@ import ( "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/config" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ces/v1/model" - rmsmodel "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/rms/v1/model" rocketmq "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/rocketmq/v2" rocketmqmodel "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/rocketmq/v2/model" @@ -62,27 +61,20 @@ func getDMSResourceAndMetrics() (map[string]labelInfo, []model.MetricInfoList) { } func getDMSInstanceFromRMS() []ResourceBaseInfo { - var resources []rmsmodel.ResourceEntity - kafkaResp, err := listResources("dms", "kafkas") + instances := make([]ResourceBaseInfo, 0) + + kafkaResp, err := getResourcesBaseInfoFromRMS("dms", "kafkas") if err != nil { logs.Logger.Errorf("Get all dms kafkas : %s", err.Error()) } else { - resources = append(resources, kafkaResp...) + instances = append(instances, kafkaResp...) } - rabbitResp, err := listResources("dms", "rabbitmqs") + rabbitResp, err := getResourcesBaseInfoFromRMS("dms", "rabbitmqs") if err != nil { logs.Logger.Errorf("Get all dms rabbitmqs: %s", err.Error()) } else { - resources = append(resources, rabbitResp...) - } - - instances := make([]ResourceBaseInfo, len(resources)) - for index, resource := range resources { - instances[index].ID = *resource.Id - instances[index].Name = *resource.Name - instances[index].EpId = *resource.EpId - instances[index].Tags = resource.Tags + instances = append(instances, rabbitResp...) } rocketMqs, err := getRocketMQInstances() diff --git a/collector/extensions.go b/collector/extensions.go index 8f0fa705..147d1a25 100644 --- a/collector/extensions.go +++ b/collector/extensions.go @@ -47,6 +47,9 @@ var ( "SYS.GES": GESInfo{}, "SYS.DBSS": DBSSInfo{}, "SYS.CC": CCInfo{}, + "SYS.LakeFormation": LakeFormationInfo{}, + "SYS.MRS": MRSInfo{}, + "SYS.DAYU": DayuInfo{}, } ) diff --git a/collector/lakeformation.go b/collector/lakeformation.go new file mode 100644 index 00000000..d77a45d3 --- /dev/null +++ b/collector/lakeformation.go @@ -0,0 +1,101 @@ +package collector + +import ( + "time" + + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/config" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ces/v1/model" + lakeformation "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1" + lakeformationmodel "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model" + + "github.com/huaweicloud/cloudeye-exporter/logs" +) + +var lakeformationInfo serversInfo + +type LakeFormationInfo struct{} + +func (getter LakeFormationInfo) GetResourceInfo() (map[string]labelInfo, []model.MetricInfoList) { + resourceInfos := map[string]labelInfo{} + filterMetrics := make([]model.MetricInfoList, 0) + lakeformationInfo.Lock() + defer lakeformationInfo.Unlock() + if lakeformationInfo.LabelInfo == nil || time.Now().Unix() > lakeformationInfo.TTL { + var instances []ResourceBaseInfo + var err error + if getResourceFromRMS("SYS.LakeFormation") { + instances, err = getAllInstanceFromRMS() + } else { + instances, err = getAllLKInstance() + } + if err != nil { + logs.Logger.Error("Get all instance error:", err.Error()) + return lakeformationInfo.LabelInfo, lakeformationInfo.FilterMetrics + } + + sysConfigMap := getMetricConfigMap("SYS.LakeFormation") + for _, instance := range instances { + if metricNames, ok := sysConfigMap["instance_id"]; ok { + metrics := buildSingleDimensionMetrics(metricNames, "SYS.LakeFormation", "instance_id", instance.ID) + filterMetrics = append(filterMetrics, metrics...) + info := labelInfo{ + Name: []string{"name", "epId"}, + Value: []string{instance.Name, instance.EpId}, + } + keys, values := getTags(instance.Tags) + info.Name = append(info.Name, keys...) + info.Value = append(info.Value, values...) + resourceInfos[GetResourceKeyFromMetricInfo(metrics[0])] = info + } + } + + lakeformationInfo.LabelInfo = resourceInfos + lakeformationInfo.FilterMetrics = filterMetrics + lakeformationInfo.TTL = time.Now().Add(TTL).Unix() + } + return lakeformationInfo.LabelInfo, lakeformationInfo.FilterMetrics +} + +func getLakeFormationClient() *lakeformation.LakeFormationClient { + return lakeformation.NewLakeFormationClient(lakeformation.LakeFormationClientBuilder().WithCredential( + basic.NewCredentialsBuilder().WithAk(conf.AccessKey).WithSk(conf.SecretKey).WithProjectId(conf.ProjectID).Build()). + WithHttpConfig(config.DefaultHttpConfig().WithIgnoreSSLVerification(true)). + WithEndpoint(getEndpoint("lakeformation", "v1")).Build()) +} + +func getAllLKInstance() ([]ResourceBaseInfo, error) { + offset := 0 + limit := 1000 + request := &lakeformationmodel.ListLakeFormationInstancesRequest{ + InRecycleBin: false, + Offset: int32(offset), + Limit: int32(limit), + EnterpriseProjectId: "all_granted_eps", + } + var instances []lakeformationmodel.LakeFormationInstance + for { + response, err := getLakeFormationClient().ListLakeFormationInstances(request) + if err != nil { + logs.Logger.Errorf("Failed to get all lk instance : %s", err.Error()) + return nil, err + } + instances = append(instances, *response.Instances...) + if len(*response.Instances) < limit { + break + } + request.Offset += request.Limit + } + + resources := make([]ResourceBaseInfo, len(instances)) + for i, instance := range instances { + resources[i].ID = *instance.InstanceId + resources[i].Name = *instance.Name + resources[i].EpId = *instance.EnterpriseProjectId + } + return resources, nil +} + +func getAllInstanceFromRMS() ([]ResourceBaseInfo, error) { + return getResourcesBaseInfoFromRMS("lakeformation", "instance") +} diff --git a/collector/mrs.go b/collector/mrs.go new file mode 100644 index 00000000..826c1b5d --- /dev/null +++ b/collector/mrs.go @@ -0,0 +1,130 @@ +package collector + +import ( + "fmt" + "strings" + "time" + + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/config" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ces/v1/model" + mrs "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1" + mrsmodel "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model" + + "github.com/huaweicloud/cloudeye-exporter/logs" +) + +var mrsInfo serversInfo + +type MRSInfo struct{} + +func (getter MRSInfo) GetResourceInfo() (map[string]labelInfo, []model.MetricInfoList) { + mrsInfo.Lock() + defer mrsInfo.Unlock() + if mrsInfo.LabelInfo == nil { + mrsInfo.LabelInfo, mrsInfo.FilterMetrics = getMRSResourceAndMetrics() + mrsInfo.TTL = time.Now().Add(TTL).Unix() + } + if time.Now().Unix() > mrsInfo.TTL { + go func() { + label, metrics := getMRSResourceAndMetrics() + mrsInfo.Lock() + defer mrsInfo.Unlock() + mrsInfo.LabelInfo = label + mrsInfo.FilterMetrics = metrics + mrsInfo.TTL = time.Now().Add(TTL).Unix() + }() + } + return mrsInfo.LabelInfo, mrsInfo.FilterMetrics +} + +func getMRSResourceAndMetrics() (map[string]labelInfo, []model.MetricInfoList) { + clusters, err := getClusterInfo() + if err != nil { + logs.Logger.Errorf("[%s] Get all clusters error: %s", err.Error()) + return nil, nil + } + + resourceInfos := map[string]labelInfo{} + for _, cluster := range clusters { + info := labelInfo{ + Name: []string{"clusterName", "epId"}, + Value: []string{cluster.Name, cluster.EpId}, + } + keys, values := getTags(cluster.Tags) + info.Name = append(info.Name, keys...) + info.Value = append(info.Value, values...) + resourceInfos[cluster.ID] = info + } + + allMetrics, err := listAllMetrics("SYS.MRS") + if err != nil { + logs.Logger.Errorf("[%s] Get all metrics of SYS.MRS error: %s", err.Error()) + } + return resourceInfos, allMetrics +} + +func getClusterInfo() ([]ResourceBaseInfo, error) { + if getResourceFromRMS("SYS.MRS") { + return getMRSClusterFromRMS() + } + return getClusterFromMRS() +} + +func getMRSClusterFromRMS() ([]ResourceBaseInfo, error) { + return getResourcesBaseInfoFromRMS("mrs", "mrs") +} + +func getMRSClient() *mrs.MrsClient { + return mrs.NewMrsClient(mrs.MrsClientBuilder().WithCredential( + basic.NewCredentialsBuilder().WithAk(conf.AccessKey).WithSk(conf.SecretKey).WithProjectId(conf.ProjectID).Build()). + WithHttpConfig(config.DefaultHttpConfig().WithIgnoreSSLVerification(true)). + WithEndpoint(getEndpoint("mrs", "v1.1")).Build()) +} + +func getClusterFromMRS() ([]ResourceBaseInfo, error) { + pageSize := 2000 + currentPage := 1 + pageSizeStr := fmt.Sprintf("%d", pageSize) + var clusters []mrsmodel.Cluster + for { + currentPageStr := fmt.Sprintf("%d", currentPage) + req := &mrsmodel.ListClustersRequest{PageSize: &pageSizeStr, CurrentPage: ¤tPageStr} + response, err := getMRSClient().ListClusters(req) + if err != nil { + logs.Logger.Errorf("Failed to get all mrs cluster : %s", err.Error()) + return nil, err + } + clusters = append(clusters, *response.Clusters...) + if len(*response.Clusters) < pageSize { + break + } + currentPage++ + } + + instances := make([]ResourceBaseInfo, len(clusters)) + for i, cluster := range clusters { + instances[i].ID = *cluster.ClusterId + instances[i].Name = *cluster.ClusterName + instances[i].EpId = *cluster.EnterpriseProjectId + instances[i].Tags = fmtMrsTags(cluster.Tags) + } + return instances, nil +} + +// fmtMrsTags mrs的tags信息,返回的是“key5=value5,key1=value1”,需要转换成map +func fmtMrsTags(tagsInfo *string) map[string]string { + if tagsInfo == nil { + return nil + } + info := strings.Split(*tagsInfo, ",") + tags := make(map[string]string, len(info)) + for _, tag := range info { + tagInfo := strings.Split(tag, "=") + if len(tagInfo) != 2 { + continue + } + tags[tagInfo[0]] = tagInfo[1] + } + return tags +} diff --git a/collector/nat.go b/collector/nat.go index 061c0b44..0fb352d5 100644 --- a/collector/nat.go +++ b/collector/nat.go @@ -4,8 +4,6 @@ import ( "time" cesmodel "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ces/v1/model" - - "github.com/huaweicloud/cloudeye-exporter/logs" ) var natInfo serversInfo @@ -42,17 +40,5 @@ func (getter NATInfo) GetResourceInfo() (map[string]labelInfo, []cesmodel.Metric } func getAllNatFromRMS() ([]ResourceBaseInfo, error) { - resp, err := listResources("nat", "natGateways") - if err != nil { - logs.Logger.Errorf("Failed to list resource of nat.natGateways, error: %s", err.Error()) - return nil, err - } - natGateways := make([]ResourceBaseInfo, len(resp)) - for index, resource := range resp { - natGateways[index].ID = *resource.Id - natGateways[index].Name = *resource.Name - natGateways[index].EpId = *resource.EpId - natGateways[index].Tags = resource.Tags - } - return natGateways, nil + return getResourcesBaseInfoFromRMS("nat", "natGateways") } diff --git a/collector/utils.go b/collector/utils.go index 15d487c9..97da4981 100644 --- a/collector/utils.go +++ b/collector/utils.go @@ -70,6 +70,9 @@ func GetResourceKeyFromMetricData(metric model.BatchMetricData) string { if *metric.Namespace == "AGT.ECS" || *metric.Namespace == "SERVICE.BMS" { return getServerResourceKey(metric) } + if *metric.Namespace == "SYS.MRS" { + return getMrsResourceKey(metric) + } sort.Slice(*metric.Dimensions, func(i, j int) bool { return (*metric.Dimensions)[i].Name < (*metric.Dimensions)[j].Name }) @@ -98,6 +101,15 @@ func getDmsResourceKey(metric model.BatchMetricData) string { return "" } +func getMrsResourceKey(metric model.BatchMetricData) string { + for _, dim := range *metric.Dimensions { + if dim.Name == "cluster_id" { + return dim.Value + } + } + return "" +} + func getEndpoint(server, version string) string { return fmt.Sprintf("https://%s/%s", strings.Replace(host, "iam", server, 1), version) } @@ -116,15 +128,17 @@ func getTags(tags map[string]string) ([]string, []string) { return keys, values } +type Tag struct { + Key string `json:"key"` + Value string `json:"value"` +} + func fmtTags(tagInfo interface{}) map[string]string { bytes, err := json.Marshal(tagInfo) if err != nil { return nil } - var tags []struct { - Key string `json:"key,omitempty"` - Value string `json:"value,omitempty"` - } + var tags []Tag err = json.Unmarshal(bytes, &tags) if err != nil { return nil @@ -218,3 +232,19 @@ func fmtResourceProperties(properties map[string]interface{}, value interface{}) return json.Unmarshal(bytes, value) } + +func getResourcesBaseInfoFromRMS(provider, resourceType string) ([]ResourceBaseInfo, error) { + resp, err := listResources(provider, resourceType) + if err != nil { + logs.Logger.Errorf("Failed to list resource of %s.%s, error: %s", provider, resourceType, err.Error()) + return nil, err + } + services := make([]ResourceBaseInfo, len(resp)) + for index, resource := range resp { + services[index].ID = *resource.Id + services[index].Name = *resource.Name + services[index].EpId = *resource.EpId + services[index].Tags = resource.Tags + } + return services, nil +} diff --git a/collector/waf.go b/collector/waf.go index 1f61f7e8..83580b94 100644 --- a/collector/waf.go +++ b/collector/waf.go @@ -47,19 +47,5 @@ func (getter WAFInfo) GetResourceInfo() (map[string]labelInfo, []model.MetricInf } func getAllWafInstancesFromRMS() ([]ResourceBaseInfo, error) { - resp, err := listResources("waf", "instance") - if err != nil { - logs.Logger.Errorf("Failed to list resource of waf.instance, error: %s", err.Error()) - return nil, err - } - wafInstances := make([]ResourceBaseInfo, 0, len(resp)) - for _, resource := range resp { - wafInstances = append(wafInstances, ResourceBaseInfo{ - ID: *resource.Id, - Name: *resource.Name, - EpId: *resource.EpId, - Tags: resource.Tags, - }) - } - return wafInstances, nil + return getResourcesBaseInfoFromRMS("waf", "instance") } diff --git a/metric.yml b/metric.yml index 2b05f652..9a25a332 100644 --- a/metric.yml +++ b/metric.yml @@ -1982,4 +1982,35 @@ SYS.CC: - network_incoming_packets - network_outgoing_packets - latency - - packet_loss_rate \ No newline at end of file + - packet_loss_rate +SYS.LakeFormation: + resource: "service" + dim_metric_name: + instance_id: + - max_latency + - avg_latency + - req_count + - req_count_2xx + - req_count_4xx + - req_count_5xx + - req_count_error + - output_throughput + - input_throughput +# MRS服务不支持指标过滤,查询全量指标 +SYS.MRS: + resource: "service" + +SYS.DAYU: + dim_metric_name: + stream_id: + - dis11_stream_record_retention_time + - dis01_stream_put_bytes_rate + - dis02_stream_get_bytes_rate + - dis03_stream_put_records + - dis04_stream_get_records + - dis05_stream_put_requests_succeed + - dis06_stream_get_requests_succeed + - dis07_stream_put_req_average_latency + - dis08_stream_get_req_average_latency + - dis09_stream_traffic_control_put_records + - dis10_stream_traffic_control_get_records \ No newline at end of file diff --git a/vendor/github.com/cihub/seelog/LICENSE.txt b/vendor/github.com/cihub/seelog/LICENSE.txt deleted file mode 100644 index 8c706814..00000000 --- a/vendor/github.com/cihub/seelog/LICENSE.txt +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2012, Cloud Instruments Co., Ltd. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Cloud Instruments Co., Ltd. nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/cihub/seelog/README.markdown b/vendor/github.com/cihub/seelog/README.markdown deleted file mode 100644 index 7dd1ab35..00000000 --- a/vendor/github.com/cihub/seelog/README.markdown +++ /dev/null @@ -1,116 +0,0 @@ -Seelog -======= - -Seelog is a powerful and easy-to-learn logging framework that provides functionality for flexible dispatching, filtering, and formatting log messages. -It is natively written in the [Go](http://golang.org/) programming language. - -[![Build Status](https://drone.io/github.com/cihub/seelog/status.png)](https://drone.io/github.com/cihub/seelog/latest) - -Features ------------------- - -* Xml configuring to be able to change logger parameters without recompilation -* Changing configurations on the fly without app restart -* Possibility to set different log configurations for different project files and functions -* Adjustable message formatting -* Simultaneous log output to multiple streams -* Choosing logger priority strategy to minimize performance hit -* Different output writers - * Console writer - * File writer - * Buffered writer (Chunk writer) - * Rolling log writer (Logging with rotation) - * SMTP writer - * Others... (See [Wiki](https://github.com/cihub/seelog/wiki)) -* Log message wrappers (JSON, XML, etc.) -* Global variables and functions for easy usage in standalone apps -* Functions for flexible usage in libraries - -Quick-start ------------ - -```go -package main - -import log "github.com/cihub/seelog" - -func main() { - defer log.Flush() - log.Info("Hello from Seelog!") -} -``` - -Installation ------------- - -If you don't have the Go development environment installed, visit the -[Getting Started](http://golang.org/doc/install.html) document and follow the instructions. Once you're ready, execute the following command: - -``` -go get -u github.com/cihub/seelog -``` - -*IMPORTANT*: If you are not using the latest release version of Go, check out this [wiki page](https://github.com/cihub/seelog/wiki/Notes-on-'go-get') - -Documentation ---------------- - -Seelog has github wiki pages, which contain detailed how-tos references: https://github.com/cihub/seelog/wiki - -Examples ---------------- - -Seelog examples can be found here: [seelog-examples](https://github.com/cihub/seelog-examples) - -Issues ---------------- - -Feel free to push issues that could make Seelog better: https://github.com/cihub/seelog/issues - -Changelog ---------------- -* **v2.6** : Config using code and custom formatters - * Configuration using code in addition to xml (All internal receiver/dispatcher/logger types are now exported). - * Custom formatters. Check [wiki](https://github.com/cihub/seelog/wiki/Custom-formatters) - * Bugfixes and internal improvements. -* **v2.5** : Interaction with other systems. Part 2: custom receivers - * Finished custom receivers feature. Check [wiki](https://github.com/cihub/seelog/wiki/custom-receivers) - * Added 'LoggerFromCustomReceiver' - * Added 'LoggerFromWriterWithMinLevelAndFormat' - * Added 'LoggerFromCustomReceiver' - * Added 'LoggerFromParamConfigAs...' -* **v2.4** : Interaction with other systems. Part 1: wrapping seelog - * Added configurable caller stack skip logic - * Added 'SetAdditionalStackDepth' to 'LoggerInterface' -* **v2.3** : Rethinking 'rolling' receiver - * Reimplemented 'rolling' receiver - * Added 'Max rolls' feature for 'rolling' receiver with type='date' - * Fixed 'rolling' receiver issue: renaming on Windows -* **v2.2** : go1.0 compatibility point [go1.0 tag] - * Fixed internal bugs - * Added 'ANSI n [;k]' format identifier: %EscN - * Made current release go1 compatible -* **v2.1** : Some new features - * Rolling receiver archiving option. - * Added format identifier: %Line - * Smtp: added paths to PEM files directories - * Added format identifier: %FuncShort - * Warn, Error and Critical methods now return an error -* **v2.0** : Second major release. BREAKING CHANGES. - * Support of binaries with stripped symbols - * Added log strategy: adaptive - * Critical message now forces Flush() - * Added predefined formats: xml-debug, xml-debug-short, xml, xml-short, json-debug, json-debug-short, json, json-short, debug, debug-short, fast - * Added receiver: conn (network connection writer) - * BREAKING CHANGE: added Tracef, Debugf, Infof, etc. to satisfy the print/printf principle - * Bug fixes -* **v1.0** : Initial release. Features: - * Xml config - * Changing configurations on the fly without app restart - * Contraints and exceptions - * Formatting - * Log strategies: sync, async loop, async timer - * Receivers: buffered, console, file, rolling, smtp - - - diff --git a/vendor/github.com/cihub/seelog/archive/archive.go b/vendor/github.com/cihub/seelog/archive/archive.go deleted file mode 100644 index 923036f2..00000000 --- a/vendor/github.com/cihub/seelog/archive/archive.go +++ /dev/null @@ -1,198 +0,0 @@ -package archive - -import ( - "archive/tar" - "archive/zip" - "fmt" - "io" - "io/ioutil" - "os" - "time" - - "github.com/cihub/seelog/archive/gzip" -) - -// Reader is the interface for reading files from an archive. -type Reader interface { - NextFile() (name string, err error) - io.Reader -} - -// ReadCloser is the interface that groups Reader with the Close method. -type ReadCloser interface { - Reader - io.Closer -} - -// Writer is the interface for writing files to an archived format. -type Writer interface { - NextFile(name string, fi os.FileInfo) error - io.Writer -} - -// WriteCloser is the interface that groups Writer with the Close method. -type WriteCloser interface { - Writer - io.Closer -} - -type nopCloser struct{ Reader } - -func (nopCloser) Close() error { return nil } - -// NopCloser returns a ReadCloser with a no-op Close method wrapping the -// provided Reader r. -func NopCloser(r Reader) ReadCloser { - return nopCloser{r} -} - -// Copy copies from src to dest until either EOF is reached on src or an error -// occurs. -// -// When the archive format of src matches that of dst, Copy streams the files -// directly into dst. Otherwise, copy buffers the contents to disk to compute -// headers before writing to dst. -func Copy(dst Writer, src Reader) error { - switch src := src.(type) { - case tarReader: - if dst, ok := dst.(tarWriter); ok { - return copyTar(dst, src) - } - case zipReader: - if dst, ok := dst.(zipWriter); ok { - return copyZip(dst, src) - } - // Switch on concrete type because gzip has no special methods - case *gzip.Reader: - if dst, ok := dst.(*gzip.Writer); ok { - _, err := io.Copy(dst, src) - return err - } - } - - return copyBuffer(dst, src) -} - -func copyBuffer(dst Writer, src Reader) (err error) { - const defaultFileMode = 0666 - - buf, err := ioutil.TempFile("", "archive_copy_buffer") - if err != nil { - return err - } - defer os.Remove(buf.Name()) // Do not care about failure removing temp - defer buf.Close() // Do not care about failure closing temp - for { - // Handle the next file - name, err := src.NextFile() - switch err { - case io.EOF: // Done copying - return nil - default: // Failed to write: bail out - return err - case nil: // Proceed below - } - - // Buffer the file - if _, err := io.Copy(buf, src); err != nil { - return fmt.Errorf("buffer to disk: %v", err) - } - - // Seek to the start of the file for full file copy - if _, err := buf.Seek(0, os.SEEK_SET); err != nil { - return err - } - - // Set desired file permissions - if err := os.Chmod(buf.Name(), defaultFileMode); err != nil { - return err - } - fi, err := buf.Stat() - if err != nil { - return err - } - - // Write the buffered file - if err := dst.NextFile(name, fi); err != nil { - return err - } - if _, err := io.Copy(dst, buf); err != nil { - return fmt.Errorf("copy to dst: %v", err) - } - if err := buf.Truncate(0); err != nil { - return err - } - if _, err := buf.Seek(0, os.SEEK_SET); err != nil { - return err - } - } -} - -type tarReader interface { - Next() (*tar.Header, error) - io.Reader -} - -type tarWriter interface { - WriteHeader(hdr *tar.Header) error - io.Writer -} - -type zipReader interface { - Files() []*zip.File -} - -type zipWriter interface { - CreateHeader(fh *zip.FileHeader) (io.Writer, error) -} - -func copyTar(w tarWriter, r tarReader) error { - for { - hdr, err := r.Next() - switch err { - case io.EOF: - return nil - default: // Handle error - return err - case nil: // Proceed below - } - - info := hdr.FileInfo() - // Skip directories - if info.IsDir() { - continue - } - if err := w.WriteHeader(hdr); err != nil { - return err - } - if _, err := io.Copy(w, r); err != nil { - return err - } - } -} - -func copyZip(zw zipWriter, r zipReader) error { - for _, f := range r.Files() { - if err := copyZipFile(zw, f); err != nil { - return err - } - } - return nil -} - -func copyZipFile(zw zipWriter, f *zip.File) error { - rc, err := f.Open() - if err != nil { - return err - } - defer rc.Close() // Read-only - - hdr := f.FileHeader - hdr.SetModTime(time.Now()) - w, err := zw.CreateHeader(&hdr) - if err != nil { - return err - } - _, err = io.Copy(w, rc) - return err -} diff --git a/vendor/github.com/cihub/seelog/archive/gzip/gzip.go b/vendor/github.com/cihub/seelog/archive/gzip/gzip.go deleted file mode 100644 index ea121018..00000000 --- a/vendor/github.com/cihub/seelog/archive/gzip/gzip.go +++ /dev/null @@ -1,64 +0,0 @@ -// Package gzip implements reading and writing of gzip format compressed files. -// See the compress/gzip package for more details. -package gzip - -import ( - "compress/gzip" - "fmt" - "io" - "os" -) - -// Reader is an io.Reader that can be read to retrieve uncompressed data from a -// gzip-format compressed file. -type Reader struct { - gzip.Reader - name string - isEOF bool -} - -// NewReader creates a new Reader reading the given reader. -func NewReader(r io.Reader, name string) (*Reader, error) { - gr, err := gzip.NewReader(r) - if err != nil { - return nil, err - } - return &Reader{ - Reader: *gr, - name: name, - }, nil -} - -// NextFile returns the file name. Calls subsequent to the first call will -// return EOF. -func (r *Reader) NextFile() (name string, err error) { - if r.isEOF { - return "", io.EOF - } - - r.isEOF = true - return r.name, nil -} - -// Writer is an io.WriteCloser. Writes to a Writer are compressed and written to w. -type Writer struct { - gzip.Writer - name string - noMoreFiles bool -} - -// NextFile never returns a next file, and should not be called more than once. -func (w *Writer) NextFile(name string, _ os.FileInfo) error { - if w.noMoreFiles { - return fmt.Errorf("gzip: only accepts one file: already received %q and now %q", w.name, name) - } - w.noMoreFiles = true - w.name = name - return nil -} - -// NewWriter returns a new Writer. Writes to the returned writer are compressed -// and written to w. -func NewWriter(w io.Writer) *Writer { - return &Writer{Writer: *gzip.NewWriter(w)} -} diff --git a/vendor/github.com/cihub/seelog/archive/tar/tar.go b/vendor/github.com/cihub/seelog/archive/tar/tar.go deleted file mode 100644 index 8dd87f57..00000000 --- a/vendor/github.com/cihub/seelog/archive/tar/tar.go +++ /dev/null @@ -1,72 +0,0 @@ -package tar - -import ( - "archive/tar" - "io" - "os" -) - -// Reader provides sequential access to the contents of a tar archive. -type Reader struct { - tar.Reader -} - -// NewReader creates a new Reader reading from r. -func NewReader(r io.Reader) *Reader { - return &Reader{Reader: *tar.NewReader(r)} -} - -// NextFile advances to the next file in the tar archive. -func (r *Reader) NextFile() (name string, err error) { - hdr, err := r.Next() - if err != nil { - return "", err - } - return hdr.Name, nil -} - -// Writer provides sequential writing of a tar archive in POSIX.1 format. -type Writer struct { - tar.Writer - closers []io.Closer -} - -// NewWriter creates a new Writer writing to w. -func NewWriter(w io.Writer) *Writer { - return &Writer{Writer: *tar.NewWriter(w)} -} - -// NewWriteMultiCloser creates a new Writer writing to w that also closes all -// closers in order on close. -func NewWriteMultiCloser(w io.WriteCloser, closers ...io.Closer) *Writer { - return &Writer{ - Writer: *tar.NewWriter(w), - closers: closers, - } -} - -// NextFile computes and writes a header and prepares to accept the file's -// contents. -func (w *Writer) NextFile(name string, fi os.FileInfo) error { - if name == "" { - name = fi.Name() - } - hdr, err := tar.FileInfoHeader(fi, name) - if err != nil { - return err - } - hdr.Name = name - return w.WriteHeader(hdr) -} - -// Close closes the tar archive and all other closers, flushing any unwritten -// data to the underlying writer. -func (w *Writer) Close() error { - err := w.Writer.Close() - for _, c := range w.closers { - if cerr := c.Close(); cerr != nil && err == nil { - err = cerr - } - } - return err -} diff --git a/vendor/github.com/cihub/seelog/archive/zip/zip.go b/vendor/github.com/cihub/seelog/archive/zip/zip.go deleted file mode 100644 index 4210b03b..00000000 --- a/vendor/github.com/cihub/seelog/archive/zip/zip.go +++ /dev/null @@ -1,89 +0,0 @@ -package zip - -import ( - "archive/zip" - "io" - "os" -) - -// Reader provides sequential access to the contents of a zip archive. -type Reader struct { - zip.Reader - unread []*zip.File - rc io.ReadCloser -} - -// NewReader returns a new Reader reading from r, which is assumed to have the -// given size in bytes. -func NewReader(r io.ReaderAt, size int64) (*Reader, error) { - zr, err := zip.NewReader(r, size) - if err != nil { - return nil, err - } - return &Reader{Reader: *zr}, nil -} - -// NextFile advances to the next file in the zip archive. -func (r *Reader) NextFile() (name string, err error) { - // Initialize unread - if r.unread == nil { - r.unread = r.Files()[:] - } - - // Close previous file - if r.rc != nil { - r.rc.Close() // Read-only - } - - if len(r.unread) == 0 { - return "", io.EOF - } - - // Open and return next unread - f := r.unread[0] - name, r.unread = f.Name, r.unread[1:] - r.rc, err = f.Open() - if err != nil { - return "", err - } - return name, nil -} - -func (r *Reader) Read(p []byte) (n int, err error) { - return r.rc.Read(p) -} - -// Files returns the full list of files in the zip archive. -func (r *Reader) Files() []*zip.File { - return r.File -} - -// Writer provides sequential writing of a zip archive.1 format. -type Writer struct { - zip.Writer - w io.Writer -} - -// NewWriter returns a new Writer writing to w. -func NewWriter(w io.Writer) *Writer { - return &Writer{Writer: *zip.NewWriter(w)} -} - -// NextFile computes and writes a header and prepares to accept the file's -// contents. -func (w *Writer) NextFile(name string, fi os.FileInfo) error { - if name == "" { - name = fi.Name() - } - hdr, err := zip.FileInfoHeader(fi) - if err != nil { - return err - } - hdr.Name = name - w.w, err = w.CreateHeader(hdr) - return err -} - -func (w *Writer) Write(p []byte) (n int, err error) { - return w.w.Write(p) -} diff --git a/vendor/github.com/cihub/seelog/behavior_adaptivelogger.go b/vendor/github.com/cihub/seelog/behavior_adaptivelogger.go deleted file mode 100644 index 0c640cae..00000000 --- a/vendor/github.com/cihub/seelog/behavior_adaptivelogger.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "errors" - "fmt" - "math" - "time" -) - -var ( - adaptiveLoggerMaxInterval = time.Minute - adaptiveLoggerMaxCriticalMsgCount = uint32(1000) -) - -// asyncAdaptiveLogger represents asynchronous adaptive logger which acts like -// an async timer logger, but its interval depends on the current message count -// in the queue. -// -// Interval = I, minInterval = m, maxInterval = M, criticalMsgCount = C, msgCount = c: -// I = m + (C - Min(c, C)) / C * (M - m) -type asyncAdaptiveLogger struct { - asyncLogger - minInterval time.Duration - criticalMsgCount uint32 - maxInterval time.Duration -} - -// NewAsyncLoopLogger creates a new asynchronous adaptive logger -func NewAsyncAdaptiveLogger( - config *logConfig, - minInterval time.Duration, - maxInterval time.Duration, - criticalMsgCount uint32) (*asyncAdaptiveLogger, error) { - - if minInterval <= 0 { - return nil, errors.New("async adaptive logger min interval should be > 0") - } - - if maxInterval > adaptiveLoggerMaxInterval { - return nil, fmt.Errorf("async adaptive logger max interval should be <= %s", - adaptiveLoggerMaxInterval) - } - - if criticalMsgCount <= 0 { - return nil, errors.New("async adaptive logger critical msg count should be > 0") - } - - if criticalMsgCount > adaptiveLoggerMaxCriticalMsgCount { - return nil, fmt.Errorf("async adaptive logger critical msg count should be <= %s", - adaptiveLoggerMaxInterval) - } - - asnAdaptiveLogger := new(asyncAdaptiveLogger) - - asnAdaptiveLogger.asyncLogger = *newAsyncLogger(config) - asnAdaptiveLogger.minInterval = minInterval - asnAdaptiveLogger.maxInterval = maxInterval - asnAdaptiveLogger.criticalMsgCount = criticalMsgCount - - go asnAdaptiveLogger.processQueue() - - return asnAdaptiveLogger, nil -} - -func (asnAdaptiveLogger *asyncAdaptiveLogger) processItem() (closed bool, itemCount int) { - asnAdaptiveLogger.queueHasElements.L.Lock() - defer asnAdaptiveLogger.queueHasElements.L.Unlock() - - for asnAdaptiveLogger.msgQueue.Len() == 0 && !asnAdaptiveLogger.Closed() { - asnAdaptiveLogger.queueHasElements.Wait() - } - - if asnAdaptiveLogger.Closed() { - return true, asnAdaptiveLogger.msgQueue.Len() - } - - asnAdaptiveLogger.processQueueElement() - return false, asnAdaptiveLogger.msgQueue.Len() - 1 -} - -// I = m + (C - Min(c, C)) / C * (M - m) => -// I = m + cDiff * mDiff, -// cDiff = (C - Min(c, C)) / C) -// mDiff = (M - m) -func (asnAdaptiveLogger *asyncAdaptiveLogger) calcAdaptiveInterval(msgCount int) time.Duration { - critCountF := float64(asnAdaptiveLogger.criticalMsgCount) - cDiff := (critCountF - math.Min(float64(msgCount), critCountF)) / critCountF - mDiff := float64(asnAdaptiveLogger.maxInterval - asnAdaptiveLogger.minInterval) - - return asnAdaptiveLogger.minInterval + time.Duration(cDiff*mDiff) -} - -func (asnAdaptiveLogger *asyncAdaptiveLogger) processQueue() { - for !asnAdaptiveLogger.Closed() { - closed, itemCount := asnAdaptiveLogger.processItem() - - if closed { - break - } - - interval := asnAdaptiveLogger.calcAdaptiveInterval(itemCount) - - <-time.After(interval) - } -} diff --git a/vendor/github.com/cihub/seelog/behavior_asynclogger.go b/vendor/github.com/cihub/seelog/behavior_asynclogger.go deleted file mode 100644 index 75231067..00000000 --- a/vendor/github.com/cihub/seelog/behavior_asynclogger.go +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "container/list" - "fmt" - "sync" -) - -// MaxQueueSize is the critical number of messages in the queue that result in an immediate flush. -const ( - MaxQueueSize = 10000 -) - -type msgQueueItem struct { - level LogLevel - context LogContextInterface - message fmt.Stringer -} - -// asyncLogger represents common data for all asynchronous loggers -type asyncLogger struct { - commonLogger - msgQueue *list.List - queueHasElements *sync.Cond -} - -// newAsyncLogger creates a new asynchronous logger -func newAsyncLogger(config *logConfig) *asyncLogger { - asnLogger := new(asyncLogger) - - asnLogger.msgQueue = list.New() - asnLogger.queueHasElements = sync.NewCond(new(sync.Mutex)) - - asnLogger.commonLogger = *newCommonLogger(config, asnLogger) - - return asnLogger -} - -func (asnLogger *asyncLogger) innerLog( - level LogLevel, - context LogContextInterface, - message fmt.Stringer) { - - asnLogger.addMsgToQueue(level, context, message) -} - -func (asnLogger *asyncLogger) Close() { - asnLogger.m.Lock() - defer asnLogger.m.Unlock() - - if !asnLogger.Closed() { - asnLogger.flushQueue(true) - asnLogger.config.RootDispatcher.Flush() - - if err := asnLogger.config.RootDispatcher.Close(); err != nil { - reportInternalError(err) - } - - asnLogger.closedM.Lock() - asnLogger.closed = true - asnLogger.closedM.Unlock() - asnLogger.queueHasElements.Broadcast() - } -} - -func (asnLogger *asyncLogger) Flush() { - asnLogger.m.Lock() - defer asnLogger.m.Unlock() - - if !asnLogger.Closed() { - asnLogger.flushQueue(true) - asnLogger.config.RootDispatcher.Flush() - } -} - -func (asnLogger *asyncLogger) flushQueue(lockNeeded bool) { - if lockNeeded { - asnLogger.queueHasElements.L.Lock() - defer asnLogger.queueHasElements.L.Unlock() - } - - for asnLogger.msgQueue.Len() > 0 { - asnLogger.processQueueElement() - } -} - -func (asnLogger *asyncLogger) processQueueElement() { - if asnLogger.msgQueue.Len() > 0 { - backElement := asnLogger.msgQueue.Front() - msg, _ := backElement.Value.(msgQueueItem) - asnLogger.processLogMsg(msg.level, msg.message, msg.context) - asnLogger.msgQueue.Remove(backElement) - } -} - -func (asnLogger *asyncLogger) addMsgToQueue( - level LogLevel, - context LogContextInterface, - message fmt.Stringer) { - - if !asnLogger.Closed() { - asnLogger.queueHasElements.L.Lock() - defer asnLogger.queueHasElements.L.Unlock() - - if asnLogger.msgQueue.Len() >= MaxQueueSize { - fmt.Printf("Seelog queue overflow: more than %v messages in the queue. Flushing.\n", MaxQueueSize) - asnLogger.flushQueue(false) - } - - queueItem := msgQueueItem{level, context, message} - - asnLogger.msgQueue.PushBack(queueItem) - asnLogger.queueHasElements.Broadcast() - } else { - err := fmt.Errorf("queue closed! Cannot process element: %d %#v", level, message) - reportInternalError(err) - } -} diff --git a/vendor/github.com/cihub/seelog/behavior_asynclooplogger.go b/vendor/github.com/cihub/seelog/behavior_asynclooplogger.go deleted file mode 100644 index 972467b3..00000000 --- a/vendor/github.com/cihub/seelog/behavior_asynclooplogger.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -// asyncLoopLogger represents asynchronous logger which processes the log queue in -// a 'for' loop -type asyncLoopLogger struct { - asyncLogger -} - -// NewAsyncLoopLogger creates a new asynchronous loop logger -func NewAsyncLoopLogger(config *logConfig) *asyncLoopLogger { - - asnLoopLogger := new(asyncLoopLogger) - - asnLoopLogger.asyncLogger = *newAsyncLogger(config) - - go asnLoopLogger.processQueue() - - return asnLoopLogger -} - -func (asnLoopLogger *asyncLoopLogger) processItem() (closed bool) { - asnLoopLogger.queueHasElements.L.Lock() - defer asnLoopLogger.queueHasElements.L.Unlock() - - for asnLoopLogger.msgQueue.Len() == 0 && !asnLoopLogger.Closed() { - asnLoopLogger.queueHasElements.Wait() - } - - if asnLoopLogger.Closed() { - return true - } - - asnLoopLogger.processQueueElement() - return false -} - -func (asnLoopLogger *asyncLoopLogger) processQueue() { - for !asnLoopLogger.Closed() { - closed := asnLoopLogger.processItem() - - if closed { - break - } - } -} diff --git a/vendor/github.com/cihub/seelog/behavior_asynctimerlogger.go b/vendor/github.com/cihub/seelog/behavior_asynctimerlogger.go deleted file mode 100644 index 8118f205..00000000 --- a/vendor/github.com/cihub/seelog/behavior_asynctimerlogger.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "errors" - "time" -) - -// asyncTimerLogger represents asynchronous logger which processes the log queue each -// 'duration' nanoseconds -type asyncTimerLogger struct { - asyncLogger - interval time.Duration -} - -// NewAsyncLoopLogger creates a new asynchronous loop logger -func NewAsyncTimerLogger(config *logConfig, interval time.Duration) (*asyncTimerLogger, error) { - - if interval <= 0 { - return nil, errors.New("async logger interval should be > 0") - } - - asnTimerLogger := new(asyncTimerLogger) - - asnTimerLogger.asyncLogger = *newAsyncLogger(config) - asnTimerLogger.interval = interval - - go asnTimerLogger.processQueue() - - return asnTimerLogger, nil -} - -func (asnTimerLogger *asyncTimerLogger) processItem() (closed bool) { - asnTimerLogger.queueHasElements.L.Lock() - defer asnTimerLogger.queueHasElements.L.Unlock() - - for asnTimerLogger.msgQueue.Len() == 0 && !asnTimerLogger.Closed() { - asnTimerLogger.queueHasElements.Wait() - } - - if asnTimerLogger.Closed() { - return true - } - - asnTimerLogger.processQueueElement() - return false -} - -func (asnTimerLogger *asyncTimerLogger) processQueue() { - for !asnTimerLogger.Closed() { - closed := asnTimerLogger.processItem() - - if closed { - break - } - - <-time.After(asnTimerLogger.interval) - } -} diff --git a/vendor/github.com/cihub/seelog/behavior_synclogger.go b/vendor/github.com/cihub/seelog/behavior_synclogger.go deleted file mode 100644 index 5a022ebc..00000000 --- a/vendor/github.com/cihub/seelog/behavior_synclogger.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "fmt" -) - -// syncLogger performs logging in the same goroutine where 'Trace/Debug/...' -// func was called -type syncLogger struct { - commonLogger -} - -// NewSyncLogger creates a new synchronous logger -func NewSyncLogger(config *logConfig) *syncLogger { - syncLogger := new(syncLogger) - - syncLogger.commonLogger = *newCommonLogger(config, syncLogger) - - return syncLogger -} - -func (syncLogger *syncLogger) innerLog( - level LogLevel, - context LogContextInterface, - message fmt.Stringer) { - - syncLogger.processLogMsg(level, message, context) -} - -func (syncLogger *syncLogger) Close() { - syncLogger.m.Lock() - defer syncLogger.m.Unlock() - - if !syncLogger.Closed() { - if err := syncLogger.config.RootDispatcher.Close(); err != nil { - reportInternalError(err) - } - syncLogger.closedM.Lock() - syncLogger.closed = true - syncLogger.closedM.Unlock() - } -} - -func (syncLogger *syncLogger) Flush() { - syncLogger.m.Lock() - defer syncLogger.m.Unlock() - - if !syncLogger.Closed() { - syncLogger.config.RootDispatcher.Flush() - } -} diff --git a/vendor/github.com/cihub/seelog/cfg_config.go b/vendor/github.com/cihub/seelog/cfg_config.go deleted file mode 100644 index 76554fca..00000000 --- a/vendor/github.com/cihub/seelog/cfg_config.go +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "bytes" - "encoding/xml" - "fmt" - "io" - "os" -) - -// LoggerFromConfigAsFile creates logger with config from file. File should contain valid seelog xml. -func LoggerFromConfigAsFile(fileName string) (LoggerInterface, error) { - file, err := os.Open(fileName) - if err != nil { - return nil, err - } - defer file.Close() - - conf, err := configFromReader(file) - if err != nil { - return nil, err - } - - return createLoggerFromFullConfig(conf) -} - -// LoggerFromConfigAsBytes creates a logger with config from bytes stream. Bytes should contain valid seelog xml. -func LoggerFromConfigAsBytes(data []byte) (LoggerInterface, error) { - conf, err := configFromReader(bytes.NewBuffer(data)) - if err != nil { - return nil, err - } - - return createLoggerFromFullConfig(conf) -} - -// LoggerFromConfigAsString creates a logger with config from a string. String should contain valid seelog xml. -func LoggerFromConfigAsString(data string) (LoggerInterface, error) { - return LoggerFromConfigAsBytes([]byte(data)) -} - -// LoggerFromParamConfigAsFile does the same as LoggerFromConfigAsFile, but includes special parser options. -// See 'CfgParseParams' comments. -func LoggerFromParamConfigAsFile(fileName string, parserParams *CfgParseParams) (LoggerInterface, error) { - file, err := os.Open(fileName) - if err != nil { - return nil, err - } - defer file.Close() - - conf, err := configFromReaderWithConfig(file, parserParams) - if err != nil { - return nil, err - } - - return createLoggerFromFullConfig(conf) -} - -// LoggerFromParamConfigAsBytes does the same as LoggerFromConfigAsBytes, but includes special parser options. -// See 'CfgParseParams' comments. -func LoggerFromParamConfigAsBytes(data []byte, parserParams *CfgParseParams) (LoggerInterface, error) { - conf, err := configFromReaderWithConfig(bytes.NewBuffer(data), parserParams) - if err != nil { - return nil, err - } - - return createLoggerFromFullConfig(conf) -} - -// LoggerFromParamConfigAsString does the same as LoggerFromConfigAsString, but includes special parser options. -// See 'CfgParseParams' comments. -func LoggerFromParamConfigAsString(data string, parserParams *CfgParseParams) (LoggerInterface, error) { - return LoggerFromParamConfigAsBytes([]byte(data), parserParams) -} - -// LoggerFromWriterWithMinLevel is shortcut for LoggerFromWriterWithMinLevelAndFormat(output, minLevel, DefaultMsgFormat) -func LoggerFromWriterWithMinLevel(output io.Writer, minLevel LogLevel) (LoggerInterface, error) { - return LoggerFromWriterWithMinLevelAndFormat(output, minLevel, DefaultMsgFormat) -} - -// LoggerFromWriterWithMinLevelAndFormat creates a proxy logger that uses io.Writer as the -// receiver with minimal level = minLevel and with specified format. -// -// All messages with level more or equal to minLevel will be written to output and -// formatted using the default seelog format. -// -// Can be called for usage with non-Seelog systems -func LoggerFromWriterWithMinLevelAndFormat(output io.Writer, minLevel LogLevel, format string) (LoggerInterface, error) { - constraints, err := NewMinMaxConstraints(minLevel, CriticalLvl) - if err != nil { - return nil, err - } - formatter, err := NewFormatter(format) - if err != nil { - return nil, err - } - dispatcher, err := NewSplitDispatcher(formatter, []interface{}{output}) - if err != nil { - return nil, err - } - - conf, err := newFullLoggerConfig(constraints, make([]*LogLevelException, 0), dispatcher, syncloggerTypeFromString, nil, nil) - if err != nil { - return nil, err - } - - return createLoggerFromFullConfig(conf) -} - -// LoggerFromXMLDecoder creates logger with config from a XML decoder starting from a specific node. -// It should contain valid seelog xml, except for root node name. -func LoggerFromXMLDecoder(xmlParser *xml.Decoder, rootNode xml.Token) (LoggerInterface, error) { - conf, err := configFromXMLDecoder(xmlParser, rootNode) - if err != nil { - return nil, err - } - - return createLoggerFromFullConfig(conf) -} - -// LoggerFromCustomReceiver creates a proxy logger that uses a CustomReceiver as the -// receiver. -// -// All messages will be sent to the specified custom receiver without additional -// formatting ('%Msg' format is used). -// -// Check CustomReceiver, RegisterReceiver for additional info. -// -// NOTE 1: CustomReceiver.AfterParse is only called when a receiver is instantiated -// by the config parser while parsing config. So, if you are not planning to use the -// same CustomReceiver for both proxying (via LoggerFromCustomReceiver call) and -// loading from config, just leave AfterParse implementation empty. -// -// NOTE 2: Unlike RegisterReceiver, LoggerFromCustomReceiver takes an already initialized -// instance that implements CustomReceiver. So, fill it with data and perform any initialization -// logic before calling this func and it won't be lost. -// -// So: -// * RegisterReceiver takes value just to get the reflect.Type from it and then -// instantiate it as many times as config is reloaded. -// -// * LoggerFromCustomReceiver takes value and uses it without modification and -// reinstantiation, directy passing it to the dispatcher tree. -func LoggerFromCustomReceiver(receiver CustomReceiver) (LoggerInterface, error) { - constraints, err := NewMinMaxConstraints(TraceLvl, CriticalLvl) - if err != nil { - return nil, err - } - - output, err := NewCustomReceiverDispatcherByValue(msgonlyformatter, receiver, "user-proxy", CustomReceiverInitArgs{}) - if err != nil { - return nil, err - } - dispatcher, err := NewSplitDispatcher(msgonlyformatter, []interface{}{output}) - if err != nil { - return nil, err - } - - conf, err := newFullLoggerConfig(constraints, make([]*LogLevelException, 0), dispatcher, syncloggerTypeFromString, nil, nil) - if err != nil { - return nil, err - } - - return createLoggerFromFullConfig(conf) -} - -func CloneLogger(logger LoggerInterface) (LoggerInterface, error) { - switch logger := logger.(type) { - default: - return nil, fmt.Errorf("unexpected type %T", logger) - case *asyncAdaptiveLogger: - clone, err := NewAsyncAdaptiveLogger(logger.commonLogger.config, logger.minInterval, logger.maxInterval, logger.criticalMsgCount) - if err != nil { - return nil, err - } - return clone, nil - case *asyncLoopLogger: - return NewAsyncLoopLogger(logger.commonLogger.config), nil - case *asyncTimerLogger: - clone, err := NewAsyncTimerLogger(logger.commonLogger.config, logger.interval) - if err != nil { - return nil, err - } - return clone, nil - case *syncLogger: - return NewSyncLogger(logger.commonLogger.config), nil - } -} diff --git a/vendor/github.com/cihub/seelog/cfg_errors.go b/vendor/github.com/cihub/seelog/cfg_errors.go deleted file mode 100644 index c1fb4d10..00000000 --- a/vendor/github.com/cihub/seelog/cfg_errors.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "errors" -) - -var ( - errNodeMustHaveChildren = errors.New("node must have children") - errNodeCannotHaveChildren = errors.New("node cannot have children") -) - -type unexpectedChildElementError struct { - baseError -} - -func newUnexpectedChildElementError(msg string) *unexpectedChildElementError { - custmsg := "Unexpected child element: " + msg - return &unexpectedChildElementError{baseError{message: custmsg}} -} - -type missingArgumentError struct { - baseError -} - -func newMissingArgumentError(nodeName, attrName string) *missingArgumentError { - custmsg := "Output '" + nodeName + "' has no '" + attrName + "' attribute" - return &missingArgumentError{baseError{message: custmsg}} -} - -type unexpectedAttributeError struct { - baseError -} - -func newUnexpectedAttributeError(nodeName, attr string) *unexpectedAttributeError { - custmsg := nodeName + " has unexpected attribute: " + attr - return &unexpectedAttributeError{baseError{message: custmsg}} -} diff --git a/vendor/github.com/cihub/seelog/cfg_logconfig.go b/vendor/github.com/cihub/seelog/cfg_logconfig.go deleted file mode 100644 index 6ba6f9a9..00000000 --- a/vendor/github.com/cihub/seelog/cfg_logconfig.go +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "errors" -) - -type loggerTypeFromString uint8 - -const ( - syncloggerTypeFromString = iota - asyncLooploggerTypeFromString - asyncTimerloggerTypeFromString - adaptiveLoggerTypeFromString - defaultloggerTypeFromString = asyncLooploggerTypeFromString -) - -const ( - syncloggerTypeFromStringStr = "sync" - asyncloggerTypeFromStringStr = "asyncloop" - asyncTimerloggerTypeFromStringStr = "asynctimer" - adaptiveLoggerTypeFromStringStr = "adaptive" -) - -// asyncTimerLoggerData represents specific data for async timer logger -type asyncTimerLoggerData struct { - AsyncInterval uint32 -} - -// adaptiveLoggerData represents specific data for adaptive timer logger -type adaptiveLoggerData struct { - MinInterval uint32 - MaxInterval uint32 - CriticalMsgCount uint32 -} - -var loggerTypeToStringRepresentations = map[loggerTypeFromString]string{ - syncloggerTypeFromString: syncloggerTypeFromStringStr, - asyncLooploggerTypeFromString: asyncloggerTypeFromStringStr, - asyncTimerloggerTypeFromString: asyncTimerloggerTypeFromStringStr, - adaptiveLoggerTypeFromString: adaptiveLoggerTypeFromStringStr, -} - -// getLoggerTypeFromString parses a string and returns a corresponding logger type, if successful. -func getLoggerTypeFromString(logTypeString string) (level loggerTypeFromString, found bool) { - for logType, logTypeStr := range loggerTypeToStringRepresentations { - if logTypeStr == logTypeString { - return logType, true - } - } - - return 0, false -} - -// logConfig stores logging configuration. Contains messages dispatcher, allowed log level rules -// (general constraints and exceptions) -type logConfig struct { - Constraints logLevelConstraints // General log level rules (>min and ' element. It takes the 'name' attribute - // of the element and tries to find a match in two places: - // 1) CfgParseParams.CustomReceiverProducers map - // 2) Global type map, filled by RegisterReceiver - // - // If a match is found in the CustomReceiverProducers map, parser calls the corresponding producer func - // passing the init args to it. The func takes exactly the same args as CustomReceiver.AfterParse. - // The producer func must return a correct receiver or an error. If case of error, seelog will behave - // in the same way as with any other config error. - // - // You may use this param to set custom producers in case you need to pass some context when instantiating - // a custom receiver or if you frequently change custom receivers with different parameters or in any other - // situation where package-level registering (RegisterReceiver) is not an option for you. - CustomReceiverProducers map[string]CustomReceiverProducer -} - -func (cfg *CfgParseParams) String() string { - return fmt.Sprintf("CfgParams: {custom_recs=%d}", len(cfg.CustomReceiverProducers)) -} - -type elementMapEntry struct { - constructor func(node *xmlNode, formatFromParent *formatter, formats map[string]*formatter, cfg *CfgParseParams) (interface{}, error) -} - -var elementMap map[string]elementMapEntry -var predefinedFormats map[string]*formatter - -func init() { - elementMap = map[string]elementMapEntry{ - fileWriterID: {createfileWriter}, - splitterDispatcherID: {createSplitter}, - customReceiverID: {createCustomReceiver}, - filterDispatcherID: {createFilter}, - consoleWriterID: {createConsoleWriter}, - rollingfileWriterID: {createRollingFileWriter}, - bufferedWriterID: {createbufferedWriter}, - smtpWriterID: {createSMTPWriter}, - connWriterID: {createconnWriter}, - } - - err := fillPredefinedFormats() - if err != nil { - panic(fmt.Sprintf("Seelog couldn't start: predefined formats creation failed. Error: %s", err.Error())) - } -} - -func fillPredefinedFormats() error { - predefinedFormatsWithoutPrefix := map[string]string{ - "xml-debug": `%Lev%Msg%RelFile%Func%Line`, - "xml-debug-short": `%Ns%l%Msg

%RelFile

%Func`, - "xml": `%Lev%Msg`, - "xml-short": `%Ns%l%Msg`, - - "json-debug": `{"time":%Ns,"lev":"%Lev","msg":"%Msg","path":"%RelFile","func":"%Func","line":"%Line"}`, - "json-debug-short": `{"t":%Ns,"l":"%Lev","m":"%Msg","p":"%RelFile","f":"%Func"}`, - "json": `{"time":%Ns,"lev":"%Lev","msg":"%Msg"}`, - "json-short": `{"t":%Ns,"l":"%Lev","m":"%Msg"}`, - - "debug": `[%LEVEL] %RelFile:%Func.%Line %Date %Time %Msg%n`, - "debug-short": `[%LEVEL] %Date %Time %Msg%n`, - "fast": `%Ns %l %Msg%n`, - } - - predefinedFormats = make(map[string]*formatter) - - for formatKey, format := range predefinedFormatsWithoutPrefix { - formatter, err := NewFormatter(format) - if err != nil { - return err - } - - predefinedFormats[predefinedPrefix+formatKey] = formatter - } - - return nil -} - -// configFromXMLDecoder parses data from a given XML decoder. -// Returns parsed config which can be used to create logger in case no errors occured. -// Returns error if format is incorrect or anything happened. -func configFromXMLDecoder(xmlParser *xml.Decoder, rootNode xml.Token) (*configForParsing, error) { - return configFromXMLDecoderWithConfig(xmlParser, rootNode, nil) -} - -// configFromXMLDecoderWithConfig parses data from a given XML decoder. -// Returns parsed config which can be used to create logger in case no errors occured. -// Returns error if format is incorrect or anything happened. -func configFromXMLDecoderWithConfig(xmlParser *xml.Decoder, rootNode xml.Token, cfg *CfgParseParams) (*configForParsing, error) { - _, ok := rootNode.(xml.StartElement) - if !ok { - return nil, errors.New("rootNode must be XML startElement") - } - - config, err := unmarshalNode(xmlParser, rootNode) - if err != nil { - return nil, err - } - if config == nil { - return nil, errors.New("xml has no content") - } - - return configFromXMLNodeWithConfig(config, cfg) -} - -// configFromReader parses data from a given reader. -// Returns parsed config which can be used to create logger in case no errors occured. -// Returns error if format is incorrect or anything happened. -func configFromReader(reader io.Reader) (*configForParsing, error) { - return configFromReaderWithConfig(reader, nil) -} - -// configFromReaderWithConfig parses data from a given reader. -// Returns parsed config which can be used to create logger in case no errors occured. -// Returns error if format is incorrect or anything happened. -func configFromReaderWithConfig(reader io.Reader, cfg *CfgParseParams) (*configForParsing, error) { - config, err := unmarshalConfig(reader) - if err != nil { - return nil, err - } - - if config.name != seelogConfigID { - return nil, errors.New("root xml tag must be '" + seelogConfigID + "'") - } - - return configFromXMLNodeWithConfig(config, cfg) -} - -func configFromXMLNodeWithConfig(config *xmlNode, cfg *CfgParseParams) (*configForParsing, error) { - err := checkUnexpectedAttribute( - config, - minLevelID, - maxLevelID, - levelsID, - loggerTypeFromStringAttr, - asyncLoggerIntervalAttr, - adaptLoggerMinIntervalAttr, - adaptLoggerMaxIntervalAttr, - adaptLoggerCriticalMsgCountAttr, - ) - if err != nil { - return nil, err - } - - err = checkExpectedElements(config, optionalElement(outputsID), optionalElement(formatsID), optionalElement(exceptionsID)) - if err != nil { - return nil, err - } - - constraints, err := getConstraints(config) - if err != nil { - return nil, err - } - - exceptions, err := getExceptions(config) - if err != nil { - return nil, err - } - err = checkDistinctExceptions(exceptions) - if err != nil { - return nil, err - } - - formats, err := getFormats(config) - if err != nil { - return nil, err - } - - dispatcher, err := getOutputsTree(config, formats, cfg) - if err != nil { - // If we open several files, but then fail to parse the config, we should close - // those files before reporting that config is invalid. - if dispatcher != nil { - dispatcher.Close() - } - - return nil, err - } - - loggerType, logData, err := getloggerTypeFromStringData(config) - if err != nil { - return nil, err - } - - return newFullLoggerConfig(constraints, exceptions, dispatcher, loggerType, logData, cfg) -} - -func getConstraints(node *xmlNode) (logLevelConstraints, error) { - minLevelStr, isMinLevel := node.attributes[minLevelID] - maxLevelStr, isMaxLevel := node.attributes[maxLevelID] - levelsStr, isLevels := node.attributes[levelsID] - - if isLevels && (isMinLevel && isMaxLevel) { - return nil, errors.New("for level declaration use '" + levelsID + "'' OR '" + minLevelID + - "', '" + maxLevelID + "'") - } - - offString := LogLevel(Off).String() - - if (isLevels && strings.TrimSpace(levelsStr) == offString) || - (isMinLevel && !isMaxLevel && minLevelStr == offString) { - - return NewOffConstraints() - } - - if isLevels { - levels, err := parseLevels(levelsStr) - if err != nil { - return nil, err - } - return NewListConstraints(levels) - } - - var minLevel = LogLevel(TraceLvl) - if isMinLevel { - found := true - minLevel, found = LogLevelFromString(minLevelStr) - if !found { - return nil, errors.New("declared " + minLevelID + " not found: " + minLevelStr) - } - } - - var maxLevel = LogLevel(CriticalLvl) - if isMaxLevel { - found := true - maxLevel, found = LogLevelFromString(maxLevelStr) - if !found { - return nil, errors.New("declared " + maxLevelID + " not found: " + maxLevelStr) - } - } - - return NewMinMaxConstraints(minLevel, maxLevel) -} - -func parseLevels(str string) ([]LogLevel, error) { - levelsStrArr := strings.Split(strings.Replace(str, " ", "", -1), ",") - var levels []LogLevel - for _, levelStr := range levelsStrArr { - level, found := LogLevelFromString(levelStr) - if !found { - return nil, errors.New("declared level not found: " + levelStr) - } - - levels = append(levels, level) - } - - return levels, nil -} - -func getExceptions(config *xmlNode) ([]*LogLevelException, error) { - var exceptions []*LogLevelException - - var exceptionsNode *xmlNode - for _, child := range config.children { - if child.name == exceptionsID { - exceptionsNode = child - break - } - } - - if exceptionsNode == nil { - return exceptions, nil - } - - err := checkUnexpectedAttribute(exceptionsNode) - if err != nil { - return nil, err - } - - err = checkExpectedElements(exceptionsNode, multipleMandatoryElements("exception")) - if err != nil { - return nil, err - } - - for _, exceptionNode := range exceptionsNode.children { - if exceptionNode.name != exceptionID { - return nil, errors.New("incorrect nested element in exceptions section: " + exceptionNode.name) - } - - err := checkUnexpectedAttribute(exceptionNode, minLevelID, maxLevelID, levelsID, funcPatternID, filePatternID) - if err != nil { - return nil, err - } - - constraints, err := getConstraints(exceptionNode) - if err != nil { - return nil, errors.New("incorrect " + exceptionsID + " node: " + err.Error()) - } - - funcPattern, isFuncPattern := exceptionNode.attributes[funcPatternID] - filePattern, isFilePattern := exceptionNode.attributes[filePatternID] - if !isFuncPattern { - funcPattern = "*" - } - if !isFilePattern { - filePattern = "*" - } - - exception, err := NewLogLevelException(funcPattern, filePattern, constraints) - if err != nil { - return nil, errors.New("incorrect exception node: " + err.Error()) - } - - exceptions = append(exceptions, exception) - } - - return exceptions, nil -} - -func checkDistinctExceptions(exceptions []*LogLevelException) error { - for i, exception := range exceptions { - for j, exception1 := range exceptions { - if i == j { - continue - } - - if exception.FuncPattern() == exception1.FuncPattern() && - exception.FilePattern() == exception1.FilePattern() { - - return fmt.Errorf("there are two or more duplicate exceptions. Func: %v, file %v", - exception.FuncPattern(), exception.FilePattern()) - } - } - } - - return nil -} - -func getFormats(config *xmlNode) (map[string]*formatter, error) { - formats := make(map[string]*formatter, 0) - - var formatsNode *xmlNode - for _, child := range config.children { - if child.name == formatsID { - formatsNode = child - break - } - } - - if formatsNode == nil { - return formats, nil - } - - err := checkUnexpectedAttribute(formatsNode) - if err != nil { - return nil, err - } - - err = checkExpectedElements(formatsNode, multipleMandatoryElements("format")) - if err != nil { - return nil, err - } - - for _, formatNode := range formatsNode.children { - if formatNode.name != formatID { - return nil, errors.New("incorrect nested element in " + formatsID + " section: " + formatNode.name) - } - - err := checkUnexpectedAttribute(formatNode, formatKeyAttrID, formatID) - if err != nil { - return nil, err - } - - id, isID := formatNode.attributes[formatKeyAttrID] - formatStr, isFormat := formatNode.attributes[formatAttrID] - if !isID { - return nil, errors.New("format has no '" + formatKeyAttrID + "' attribute") - } - if !isFormat { - return nil, errors.New("format[" + id + "] has no '" + formatAttrID + "' attribute") - } - - formatter, err := NewFormatter(formatStr) - if err != nil { - return nil, err - } - - formats[id] = formatter - } - - return formats, nil -} - -func getloggerTypeFromStringData(config *xmlNode) (logType loggerTypeFromString, logData interface{}, err error) { - logTypeStr, loggerTypeExists := config.attributes[loggerTypeFromStringAttr] - - if !loggerTypeExists { - return defaultloggerTypeFromString, nil, nil - } - - logType, found := getLoggerTypeFromString(logTypeStr) - - if !found { - return 0, nil, fmt.Errorf("unknown logger type: %s", logTypeStr) - } - - if logType == asyncTimerloggerTypeFromString { - intervalStr, intervalExists := config.attributes[asyncLoggerIntervalAttr] - if !intervalExists { - return 0, nil, newMissingArgumentError(config.name, asyncLoggerIntervalAttr) - } - - interval, err := strconv.ParseUint(intervalStr, 10, 32) - if err != nil { - return 0, nil, err - } - - logData = asyncTimerLoggerData{uint32(interval)} - } else if logType == adaptiveLoggerTypeFromString { - - // Min interval - minIntStr, minIntExists := config.attributes[adaptLoggerMinIntervalAttr] - if !minIntExists { - return 0, nil, newMissingArgumentError(config.name, adaptLoggerMinIntervalAttr) - } - minInterval, err := strconv.ParseUint(minIntStr, 10, 32) - if err != nil { - return 0, nil, err - } - - // Max interval - maxIntStr, maxIntExists := config.attributes[adaptLoggerMaxIntervalAttr] - if !maxIntExists { - return 0, nil, newMissingArgumentError(config.name, adaptLoggerMaxIntervalAttr) - } - maxInterval, err := strconv.ParseUint(maxIntStr, 10, 32) - if err != nil { - return 0, nil, err - } - - // Critical msg count - criticalMsgCountStr, criticalMsgCountExists := config.attributes[adaptLoggerCriticalMsgCountAttr] - if !criticalMsgCountExists { - return 0, nil, newMissingArgumentError(config.name, adaptLoggerCriticalMsgCountAttr) - } - criticalMsgCount, err := strconv.ParseUint(criticalMsgCountStr, 10, 32) - if err != nil { - return 0, nil, err - } - - logData = adaptiveLoggerData{uint32(minInterval), uint32(maxInterval), uint32(criticalMsgCount)} - } - - return logType, logData, nil -} - -func getOutputsTree(config *xmlNode, formats map[string]*formatter, cfg *CfgParseParams) (dispatcherInterface, error) { - var outputsNode *xmlNode - for _, child := range config.children { - if child.name == outputsID { - outputsNode = child - break - } - } - - if outputsNode != nil { - err := checkUnexpectedAttribute(outputsNode, outputFormatID) - if err != nil { - return nil, err - } - - formatter, err := getCurrentFormat(outputsNode, DefaultFormatter, formats) - if err != nil { - return nil, err - } - - output, err := createSplitter(outputsNode, formatter, formats, cfg) - if err != nil { - return nil, err - } - - dispatcher, ok := output.(dispatcherInterface) - if ok { - return dispatcher, nil - } - } - - console, err := NewConsoleWriter() - if err != nil { - return nil, err - } - return NewSplitDispatcher(DefaultFormatter, []interface{}{console}) -} - -func getCurrentFormat(node *xmlNode, formatFromParent *formatter, formats map[string]*formatter) (*formatter, error) { - formatID, isFormatID := node.attributes[outputFormatID] - if !isFormatID { - return formatFromParent, nil - } - - format, ok := formats[formatID] - if ok { - return format, nil - } - - // Test for predefined format match - pdFormat, pdOk := predefinedFormats[formatID] - - if !pdOk { - return nil, errors.New("formatid = '" + formatID + "' doesn't exist") - } - - return pdFormat, nil -} - -func createInnerReceivers(node *xmlNode, format *formatter, formats map[string]*formatter, cfg *CfgParseParams) ([]interface{}, error) { - var outputs []interface{} - for _, childNode := range node.children { - entry, ok := elementMap[childNode.name] - if !ok { - return nil, errors.New("unnknown tag '" + childNode.name + "' in outputs section") - } - - output, err := entry.constructor(childNode, format, formats, cfg) - if err != nil { - return nil, err - } - - outputs = append(outputs, output) - } - - return outputs, nil -} - -func createSplitter(node *xmlNode, formatFromParent *formatter, formats map[string]*formatter, cfg *CfgParseParams) (interface{}, error) { - err := checkUnexpectedAttribute(node, outputFormatID) - if err != nil { - return nil, err - } - - if !node.hasChildren() { - return nil, errNodeMustHaveChildren - } - - currentFormat, err := getCurrentFormat(node, formatFromParent, formats) - if err != nil { - return nil, err - } - - receivers, err := createInnerReceivers(node, currentFormat, formats, cfg) - if err != nil { - return nil, err - } - - return NewSplitDispatcher(currentFormat, receivers) -} - -func createCustomReceiver(node *xmlNode, formatFromParent *formatter, formats map[string]*formatter, cfg *CfgParseParams) (interface{}, error) { - dataCustomPrefixes := make(map[string]string) - // Expecting only 'formatid', 'name' and 'data-' attrs - for attr, attrval := range node.attributes { - isExpected := false - if attr == outputFormatID || - attr == customNameAttrID { - isExpected = true - } - if strings.HasPrefix(attr, customNameDataAttrPrefix) { - dataCustomPrefixes[attr[len(customNameDataAttrPrefix):]] = attrval - isExpected = true - } - if !isExpected { - return nil, newUnexpectedAttributeError(node.name, attr) - } - } - - if node.hasChildren() { - return nil, errNodeCannotHaveChildren - } - customName, hasCustomName := node.attributes[customNameAttrID] - if !hasCustomName { - return nil, newMissingArgumentError(node.name, customNameAttrID) - } - currentFormat, err := getCurrentFormat(node, formatFromParent, formats) - if err != nil { - return nil, err - } - args := CustomReceiverInitArgs{ - XmlCustomAttrs: dataCustomPrefixes, - } - - if cfg != nil && cfg.CustomReceiverProducers != nil { - if prod, ok := cfg.CustomReceiverProducers[customName]; ok { - rec, err := prod(args) - if err != nil { - return nil, err - } - creceiver, err := NewCustomReceiverDispatcherByValue(currentFormat, rec, customName, args) - if err != nil { - return nil, err - } - err = rec.AfterParse(args) - if err != nil { - return nil, err - } - return creceiver, nil - } - } - - return NewCustomReceiverDispatcher(currentFormat, customName, args) -} - -func createFilter(node *xmlNode, formatFromParent *formatter, formats map[string]*formatter, cfg *CfgParseParams) (interface{}, error) { - err := checkUnexpectedAttribute(node, outputFormatID, filterLevelsAttrID) - if err != nil { - return nil, err - } - - if !node.hasChildren() { - return nil, errNodeMustHaveChildren - } - - currentFormat, err := getCurrentFormat(node, formatFromParent, formats) - if err != nil { - return nil, err - } - - levelsStr, isLevels := node.attributes[filterLevelsAttrID] - if !isLevels { - return nil, newMissingArgumentError(node.name, filterLevelsAttrID) - } - - levels, err := parseLevels(levelsStr) - if err != nil { - return nil, err - } - - receivers, err := createInnerReceivers(node, currentFormat, formats, cfg) - if err != nil { - return nil, err - } - - return NewFilterDispatcher(currentFormat, receivers, levels...) -} - -func createfileWriter(node *xmlNode, formatFromParent *formatter, formats map[string]*formatter, cfg *CfgParseParams) (interface{}, error) { - err := checkUnexpectedAttribute(node, outputFormatID, pathID) - if err != nil { - return nil, err - } - - if node.hasChildren() { - return nil, errNodeCannotHaveChildren - } - - currentFormat, err := getCurrentFormat(node, formatFromParent, formats) - if err != nil { - return nil, err - } - - path, isPath := node.attributes[pathID] - if !isPath { - return nil, newMissingArgumentError(node.name, pathID) - } - - fileWriter, err := NewFileWriter(path) - if err != nil { - return nil, err - } - - return NewFormattedWriter(fileWriter, currentFormat) -} - -// Creates new SMTP writer if encountered in the config file. -func createSMTPWriter(node *xmlNode, formatFromParent *formatter, formats map[string]*formatter, cfg *CfgParseParams) (interface{}, error) { - err := checkUnexpectedAttribute(node, outputFormatID, senderaddressID, senderNameID, hostNameID, hostPortID, userNameID, userPassID, subjectID) - if err != nil { - return nil, err - } - // Node must have children. - if !node.hasChildren() { - return nil, errNodeMustHaveChildren - } - currentFormat, err := getCurrentFormat(node, formatFromParent, formats) - if err != nil { - return nil, err - } - senderAddress, ok := node.attributes[senderaddressID] - if !ok { - return nil, newMissingArgumentError(node.name, senderaddressID) - } - senderName, ok := node.attributes[senderNameID] - if !ok { - return nil, newMissingArgumentError(node.name, senderNameID) - } - // Process child nodes scanning for recipient email addresses and/or CA certificate paths. - var recipientAddresses []string - var caCertDirPaths []string - var mailHeaders []string - for _, childNode := range node.children { - switch childNode.name { - // Extract recipient address from child nodes. - case recipientID: - address, ok := childNode.attributes[addressID] - if !ok { - return nil, newMissingArgumentError(childNode.name, addressID) - } - recipientAddresses = append(recipientAddresses, address) - // Extract CA certificate file path from child nodes. - case cACertDirpathID: - path, ok := childNode.attributes[pathID] - if !ok { - return nil, newMissingArgumentError(childNode.name, pathID) - } - caCertDirPaths = append(caCertDirPaths, path) - - // Extract email headers from child nodes. - case mailHeaderID: - headerName, ok := childNode.attributes[mailHeaderNameID] - if !ok { - return nil, newMissingArgumentError(childNode.name, mailHeaderNameID) - } - - headerValue, ok := childNode.attributes[mailHeaderValueID] - if !ok { - return nil, newMissingArgumentError(childNode.name, mailHeaderValueID) - } - - // Build header line - mailHeaders = append(mailHeaders, fmt.Sprintf("%s: %s", headerName, headerValue)) - default: - return nil, newUnexpectedChildElementError(childNode.name) - } - } - hostName, ok := node.attributes[hostNameID] - if !ok { - return nil, newMissingArgumentError(node.name, hostNameID) - } - - hostPort, ok := node.attributes[hostPortID] - if !ok { - return nil, newMissingArgumentError(node.name, hostPortID) - } - - // Check if the string can really be converted into int. - if _, err := strconv.Atoi(hostPort); err != nil { - return nil, errors.New("invalid host port number") - } - - userName, ok := node.attributes[userNameID] - if !ok { - return nil, newMissingArgumentError(node.name, userNameID) - } - - userPass, ok := node.attributes[userPassID] - if !ok { - return nil, newMissingArgumentError(node.name, userPassID) - } - - // subject is optionally set by configuration. - // default value is defined by DefaultSubjectPhrase constant in the writers_smtpwriter.go - var subjectPhrase = DefaultSubjectPhrase - - subject, ok := node.attributes[subjectID] - if ok { - subjectPhrase = subject - } - - smtpWriter := NewSMTPWriter( - senderAddress, - senderName, - recipientAddresses, - hostName, - hostPort, - userName, - userPass, - caCertDirPaths, - subjectPhrase, - mailHeaders, - ) - - return NewFormattedWriter(smtpWriter, currentFormat) -} - -func createConsoleWriter(node *xmlNode, formatFromParent *formatter, formats map[string]*formatter, cfg *CfgParseParams) (interface{}, error) { - err := checkUnexpectedAttribute(node, outputFormatID) - if err != nil { - return nil, err - } - - if node.hasChildren() { - return nil, errNodeCannotHaveChildren - } - - currentFormat, err := getCurrentFormat(node, formatFromParent, formats) - if err != nil { - return nil, err - } - - consoleWriter, err := NewConsoleWriter() - if err != nil { - return nil, err - } - - return NewFormattedWriter(consoleWriter, currentFormat) -} - -func createconnWriter(node *xmlNode, formatFromParent *formatter, formats map[string]*formatter, cfg *CfgParseParams) (interface{}, error) { - if node.hasChildren() { - return nil, errNodeCannotHaveChildren - } - - err := checkUnexpectedAttribute(node, outputFormatID, connWriterAddrAttr, connWriterNetAttr, connWriterReconnectOnMsgAttr, connWriterUseTLSAttr, connWriterInsecureSkipVerifyAttr) - if err != nil { - return nil, err - } - - currentFormat, err := getCurrentFormat(node, formatFromParent, formats) - if err != nil { - return nil, err - } - - addr, isAddr := node.attributes[connWriterAddrAttr] - if !isAddr { - return nil, newMissingArgumentError(node.name, connWriterAddrAttr) - } - - net, isNet := node.attributes[connWriterNetAttr] - if !isNet { - return nil, newMissingArgumentError(node.name, connWriterNetAttr) - } - - reconnectOnMsg := false - reconnectOnMsgStr, isReconnectOnMsgStr := node.attributes[connWriterReconnectOnMsgAttr] - if isReconnectOnMsgStr { - if reconnectOnMsgStr == "true" { - reconnectOnMsg = true - } else if reconnectOnMsgStr == "false" { - reconnectOnMsg = false - } else { - return nil, errors.New("node '" + node.name + "' has incorrect '" + connWriterReconnectOnMsgAttr + "' attribute value") - } - } - - useTLS := false - useTLSStr, isUseTLSStr := node.attributes[connWriterUseTLSAttr] - if isUseTLSStr { - if useTLSStr == "true" { - useTLS = true - } else if useTLSStr == "false" { - useTLS = false - } else { - return nil, errors.New("node '" + node.name + "' has incorrect '" + connWriterUseTLSAttr + "' attribute value") - } - if useTLS { - insecureSkipVerify := false - insecureSkipVerifyStr, isInsecureSkipVerify := node.attributes[connWriterInsecureSkipVerifyAttr] - if isInsecureSkipVerify { - if insecureSkipVerifyStr == "true" { - insecureSkipVerify = true - } else if insecureSkipVerifyStr == "false" { - insecureSkipVerify = false - } else { - return nil, errors.New("node '" + node.name + "' has incorrect '" + connWriterInsecureSkipVerifyAttr + "' attribute value") - } - } - config := tls.Config{InsecureSkipVerify: insecureSkipVerify} - connWriter := newTLSWriter(net, addr, reconnectOnMsg, &config) - return NewFormattedWriter(connWriter, currentFormat) - } - } - - connWriter := NewConnWriter(net, addr, reconnectOnMsg) - - return NewFormattedWriter(connWriter, currentFormat) -} - -func createRollingFileWriter(node *xmlNode, formatFromParent *formatter, formats map[string]*formatter, cfg *CfgParseParams) (interface{}, error) { - if node.hasChildren() { - return nil, errNodeCannotHaveChildren - } - - rollingTypeStr, isRollingType := node.attributes[rollingFileTypeAttr] - if !isRollingType { - return nil, newMissingArgumentError(node.name, rollingFileTypeAttr) - } - - rollingType, ok := rollingTypeFromString(rollingTypeStr) - if !ok { - return nil, errors.New("unknown rolling file type: " + rollingTypeStr) - } - - currentFormat, err := getCurrentFormat(node, formatFromParent, formats) - if err != nil { - return nil, err - } - - path, isPath := node.attributes[rollingFilePathAttr] - if !isPath { - return nil, newMissingArgumentError(node.name, rollingFilePathAttr) - } - - rollingArchiveStr, archiveAttrExists := node.attributes[rollingFileArchiveAttr] - - var rArchiveType rollingArchiveType - var rArchivePath string - var rArchiveExploded bool = false - if !archiveAttrExists { - rArchiveType = rollingArchiveNone - rArchivePath = "" - } else { - rArchiveType, ok = rollingArchiveTypeFromString(rollingArchiveStr) - if !ok { - return nil, errors.New("unknown rolling archive type: " + rollingArchiveStr) - } - - if rArchiveType == rollingArchiveNone { - rArchivePath = "" - } else { - if rArchiveExplodedAttr, ok := node.attributes[rollingFileArchiveExplodedAttr]; ok { - if rArchiveExploded, err = strconv.ParseBool(rArchiveExplodedAttr); err != nil { - return nil, fmt.Errorf("archive exploded should be true or false, but was %v", - rArchiveExploded) - } - } - - rArchivePath, ok = node.attributes[rollingFileArchivePathAttr] - if ok { - if rArchivePath == "" { - return nil, fmt.Errorf("empty archive path is not supported") - } - } else { - if rArchiveExploded { - rArchivePath = rollingArchiveDefaultExplodedName - - } else { - rArchivePath, err = rollingArchiveTypeDefaultName(rArchiveType, false) - if err != nil { - return nil, err - } - } - } - } - } - - nameMode := rollingNameMode(rollingNameModePostfix) - nameModeStr, ok := node.attributes[rollingFileNameModeAttr] - if ok { - mode, found := rollingNameModeFromString(nameModeStr) - if !found { - return nil, errors.New("unknown rolling filename mode: " + nameModeStr) - } else { - nameMode = mode - } - } - - if rollingType == rollingTypeSize { - err := checkUnexpectedAttribute(node, outputFormatID, rollingFileTypeAttr, rollingFilePathAttr, - rollingFileMaxSizeAttr, rollingFileMaxRollsAttr, rollingFileArchiveAttr, - rollingFileArchivePathAttr, rollingFileArchiveExplodedAttr, rollingFileNameModeAttr) - if err != nil { - return nil, err - } - - maxSizeStr, ok := node.attributes[rollingFileMaxSizeAttr] - if !ok { - return nil, newMissingArgumentError(node.name, rollingFileMaxSizeAttr) - } - - maxSize, err := strconv.ParseInt(maxSizeStr, 10, 64) - if err != nil { - return nil, err - } - - maxRolls := 0 - maxRollsStr, ok := node.attributes[rollingFileMaxRollsAttr] - if ok { - maxRolls, err = strconv.Atoi(maxRollsStr) - if err != nil { - return nil, err - } - } - - rollingWriter, err := NewRollingFileWriterSize(path, rArchiveType, rArchivePath, maxSize, maxRolls, nameMode, rArchiveExploded) - if err != nil { - return nil, err - } - - return NewFormattedWriter(rollingWriter, currentFormat) - - } else if rollingType == rollingTypeTime { - err := checkUnexpectedAttribute(node, outputFormatID, rollingFileTypeAttr, rollingFilePathAttr, - rollingFileDataPatternAttr, rollingFileArchiveAttr, rollingFileMaxRollsAttr, - rollingFileArchivePathAttr, rollingFileArchiveExplodedAttr, rollingFileNameModeAttr, - rollingFileFullNameAttr) - if err != nil { - return nil, err - } - - maxRolls := 0 - maxRollsStr, ok := node.attributes[rollingFileMaxRollsAttr] - if ok { - maxRolls, err = strconv.Atoi(maxRollsStr) - if err != nil { - return nil, err - } - } - - fullName := false - fn, ok := node.attributes[rollingFileFullNameAttr] - if ok { - if fn == "true" { - fullName = true - } else if fn == "false" { - fullName = false - } else { - return nil, errors.New("node '" + node.name + "' has incorrect '" + rollingFileFullNameAttr + "' attribute value") - } - } - - dataPattern, ok := node.attributes[rollingFileDataPatternAttr] - if !ok { - return nil, newMissingArgumentError(node.name, rollingFileDataPatternAttr) - } - - rollingWriter, err := NewRollingFileWriterTime(path, rArchiveType, rArchivePath, maxRolls, dataPattern, nameMode, rArchiveExploded, fullName) - if err != nil { - return nil, err - } - - return NewFormattedWriter(rollingWriter, currentFormat) - } - - return nil, errors.New("incorrect rolling writer type " + rollingTypeStr) -} - -func createbufferedWriter(node *xmlNode, formatFromParent *formatter, formats map[string]*formatter, cfg *CfgParseParams) (interface{}, error) { - err := checkUnexpectedAttribute(node, outputFormatID, bufferedSizeAttr, bufferedFlushPeriodAttr) - if err != nil { - return nil, err - } - - if !node.hasChildren() { - return nil, errNodeMustHaveChildren - } - - currentFormat, err := getCurrentFormat(node, formatFromParent, formats) - if err != nil { - return nil, err - } - - sizeStr, isSize := node.attributes[bufferedSizeAttr] - if !isSize { - return nil, newMissingArgumentError(node.name, bufferedSizeAttr) - } - - size, err := strconv.Atoi(sizeStr) - if err != nil { - return nil, err - } - - flushPeriod := 0 - flushPeriodStr, isFlushPeriod := node.attributes[bufferedFlushPeriodAttr] - if isFlushPeriod { - flushPeriod, err = strconv.Atoi(flushPeriodStr) - if err != nil { - return nil, err - } - } - - // Inner writer couldn't have its own format, so we pass 'currentFormat' as its parent format - receivers, err := createInnerReceivers(node, currentFormat, formats, cfg) - if err != nil { - return nil, err - } - - formattedWriter, ok := receivers[0].(*formattedWriter) - if !ok { - return nil, errors.New("buffered writer's child is not writer") - } - - // ... and then we check that it hasn't changed - if formattedWriter.Format() != currentFormat { - return nil, errors.New("inner writer cannot have his own format") - } - - bufferedWriter, err := NewBufferedWriter(formattedWriter.Writer(), size, time.Duration(flushPeriod)) - if err != nil { - return nil, err - } - - return NewFormattedWriter(bufferedWriter, currentFormat) -} - -// Returns an error if node has any attributes not listed in expectedAttrs. -func checkUnexpectedAttribute(node *xmlNode, expectedAttrs ...string) error { - for attr := range node.attributes { - isExpected := false - for _, expected := range expectedAttrs { - if attr == expected { - isExpected = true - break - } - } - if !isExpected { - return newUnexpectedAttributeError(node.name, attr) - } - } - - return nil -} - -type expectedElementInfo struct { - name string - mandatory bool - multiple bool -} - -func optionalElement(name string) expectedElementInfo { - return expectedElementInfo{name, false, false} -} -func mandatoryElement(name string) expectedElementInfo { - return expectedElementInfo{name, true, false} -} -func multipleElements(name string) expectedElementInfo { - return expectedElementInfo{name, false, true} -} -func multipleMandatoryElements(name string) expectedElementInfo { - return expectedElementInfo{name, true, true} -} - -func checkExpectedElements(node *xmlNode, elements ...expectedElementInfo) error { - for _, element := range elements { - count := 0 - for _, child := range node.children { - if child.name == element.name { - count++ - } - } - - if count == 0 && element.mandatory { - return errors.New(node.name + " does not have mandatory subnode - " + element.name) - } - if count > 1 && !element.multiple { - return errors.New(node.name + " has more then one subnode - " + element.name) - } - } - - for _, child := range node.children { - isExpected := false - for _, element := range elements { - if child.name == element.name { - isExpected = true - } - } - - if !isExpected { - return errors.New(node.name + " has unexpected child: " + child.name) - } - } - - return nil -} diff --git a/vendor/github.com/cihub/seelog/common_closer.go b/vendor/github.com/cihub/seelog/common_closer.go deleted file mode 100644 index 1319c221..00000000 --- a/vendor/github.com/cihub/seelog/common_closer.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog diff --git a/vendor/github.com/cihub/seelog/common_constraints.go b/vendor/github.com/cihub/seelog/common_constraints.go deleted file mode 100644 index 7ec2fe5b..00000000 --- a/vendor/github.com/cihub/seelog/common_constraints.go +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "errors" - "fmt" - "strings" -) - -// Represents constraints which form a general rule for log levels selection -type logLevelConstraints interface { - IsAllowed(level LogLevel) bool -} - -// A minMaxConstraints represents constraints which use minimal and maximal allowed log levels. -type minMaxConstraints struct { - min LogLevel - max LogLevel -} - -// NewMinMaxConstraints creates a new minMaxConstraints struct with the specified min and max levels. -func NewMinMaxConstraints(min LogLevel, max LogLevel) (*minMaxConstraints, error) { - if min > max { - return nil, fmt.Errorf("min level can't be greater than max. Got min: %d, max: %d", min, max) - } - if min < TraceLvl || min > CriticalLvl { - return nil, fmt.Errorf("min level can't be less than Trace or greater than Critical. Got min: %d", min) - } - if max < TraceLvl || max > CriticalLvl { - return nil, fmt.Errorf("max level can't be less than Trace or greater than Critical. Got max: %d", max) - } - - return &minMaxConstraints{min, max}, nil -} - -// IsAllowed returns true, if log level is in [min, max] range (inclusive). -func (minMaxConstr *minMaxConstraints) IsAllowed(level LogLevel) bool { - return level >= minMaxConstr.min && level <= minMaxConstr.max -} - -func (minMaxConstr *minMaxConstraints) String() string { - return fmt.Sprintf("Min: %s. Max: %s", minMaxConstr.min, minMaxConstr.max) -} - -//======================================================= - -// A listConstraints represents constraints which use allowed log levels list. -type listConstraints struct { - allowedLevels map[LogLevel]bool -} - -// NewListConstraints creates a new listConstraints struct with the specified allowed levels. -func NewListConstraints(allowList []LogLevel) (*listConstraints, error) { - if allowList == nil { - return nil, errors.New("list can't be nil") - } - - allowLevels, err := createMapFromList(allowList) - if err != nil { - return nil, err - } - err = validateOffLevel(allowLevels) - if err != nil { - return nil, err - } - - return &listConstraints{allowLevels}, nil -} - -func (listConstr *listConstraints) String() string { - allowedList := "List: " - - listLevel := make([]string, len(listConstr.allowedLevels)) - - var logLevel LogLevel - i := 0 - for logLevel = TraceLvl; logLevel <= Off; logLevel++ { - if listConstr.allowedLevels[logLevel] { - listLevel[i] = logLevel.String() - i++ - } - } - - allowedList += strings.Join(listLevel, ",") - - return allowedList -} - -func createMapFromList(allowedList []LogLevel) (map[LogLevel]bool, error) { - allowedLevels := make(map[LogLevel]bool, 0) - for _, level := range allowedList { - if level < TraceLvl || level > Off { - return nil, fmt.Errorf("level can't be less than Trace or greater than Critical. Got level: %d", level) - } - allowedLevels[level] = true - } - return allowedLevels, nil -} -func validateOffLevel(allowedLevels map[LogLevel]bool) error { - if _, ok := allowedLevels[Off]; ok && len(allowedLevels) > 1 { - return errors.New("logLevel Off cant be mixed with other levels") - } - - return nil -} - -// IsAllowed returns true, if log level is in allowed log levels list. -// If the list contains the only item 'common.Off' then IsAllowed will always return false for any input values. -func (listConstr *listConstraints) IsAllowed(level LogLevel) bool { - for l := range listConstr.allowedLevels { - if l == level && level != Off { - return true - } - } - - return false -} - -// AllowedLevels returns allowed levels configuration as a map. -func (listConstr *listConstraints) AllowedLevels() map[LogLevel]bool { - return listConstr.allowedLevels -} - -//======================================================= - -type offConstraints struct { -} - -func NewOffConstraints() (*offConstraints, error) { - return &offConstraints{}, nil -} - -func (offConstr *offConstraints) IsAllowed(level LogLevel) bool { - return false -} - -func (offConstr *offConstraints) String() string { - return "Off constraint" -} diff --git a/vendor/github.com/cihub/seelog/common_context.go b/vendor/github.com/cihub/seelog/common_context.go deleted file mode 100644 index 230a76ca..00000000 --- a/vendor/github.com/cihub/seelog/common_context.go +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "errors" - "fmt" - "os" - "path/filepath" - "runtime" - "strings" - "sync" - "time" -) - -var ( - workingDir = "/" - stackCache map[uintptr]*logContext - stackCacheLock sync.RWMutex -) - -func init() { - wd, err := os.Getwd() - if err == nil { - workingDir = filepath.ToSlash(wd) + "/" - } - stackCache = make(map[uintptr]*logContext) -} - -// Represents runtime caller context. -type LogContextInterface interface { - // Caller's function name. - Func() string - // Caller's line number. - Line() int - // Caller's file short path (in slashed form). - ShortPath() string - // Caller's file full path (in slashed form). - FullPath() string - // Caller's file name (without path). - FileName() string - // True if the context is correct and may be used. - // If false, then an error in context evaluation occurred and - // all its other data may be corrupted. - IsValid() bool - // Time when log function was called. - CallTime() time.Time - // Custom context that can be set by calling logger.SetContext - CustomContext() interface{} -} - -// Returns context of the caller -func currentContext(custom interface{}) (LogContextInterface, error) { - return specifyContext(1, custom) -} - -func extractCallerInfo(skip int) (*logContext, error) { - var stack [1]uintptr - if runtime.Callers(skip+1, stack[:]) != 1 { - return nil, errors.New("error during runtime.Callers") - } - pc := stack[0] - - // do we have a cache entry? - stackCacheLock.RLock() - ctx, ok := stackCache[pc] - stackCacheLock.RUnlock() - if ok { - return ctx, nil - } - - // look up the details of the given caller - funcInfo := runtime.FuncForPC(pc) - if funcInfo == nil { - return nil, errors.New("error during runtime.FuncForPC") - } - - var shortPath string - fullPath, line := funcInfo.FileLine(pc) - if strings.HasPrefix(fullPath, workingDir) { - shortPath = fullPath[len(workingDir):] - } else { - shortPath = fullPath - } - funcName := funcInfo.Name() - if strings.HasPrefix(funcName, workingDir) { - funcName = funcName[len(workingDir):] - } - - ctx = &logContext{ - funcName: funcName, - line: line, - shortPath: shortPath, - fullPath: fullPath, - fileName: filepath.Base(fullPath), - } - - // save the details in the cache; note that it's possible we might - // have written an entry into the map in between the test above and - // this section, but the behaviour is still correct - stackCacheLock.Lock() - stackCache[pc] = ctx - stackCacheLock.Unlock() - return ctx, nil -} - -// Returns context of the function with placed "skip" stack frames of the caller -// If skip == 0 then behaves like currentContext -// Context is returned in any situation, even if error occurs. But, if an error -// occurs, the returned context is an error context, which contains no paths -// or names, but states that they can't be extracted. -func specifyContext(skip int, custom interface{}) (LogContextInterface, error) { - callTime := time.Now() - if skip < 0 { - err := fmt.Errorf("can not skip negative stack frames") - return &errorContext{callTime, err}, err - } - caller, err := extractCallerInfo(skip + 2) - if err != nil { - return &errorContext{callTime, err}, err - } - ctx := new(logContext) - *ctx = *caller - ctx.callTime = callTime - ctx.custom = custom - return ctx, nil -} - -// Represents a normal runtime caller context. -type logContext struct { - funcName string - line int - shortPath string - fullPath string - fileName string - callTime time.Time - custom interface{} -} - -func (context *logContext) IsValid() bool { - return true -} - -func (context *logContext) Func() string { - return context.funcName -} - -func (context *logContext) Line() int { - return context.line -} - -func (context *logContext) ShortPath() string { - return context.shortPath -} - -func (context *logContext) FullPath() string { - return context.fullPath -} - -func (context *logContext) FileName() string { - return context.fileName -} - -func (context *logContext) CallTime() time.Time { - return context.callTime -} - -func (context *logContext) CustomContext() interface{} { - return context.custom -} - -// Represents an error context -type errorContext struct { - errorTime time.Time - err error -} - -func (errContext *errorContext) getErrorText(prefix string) string { - return fmt.Sprintf("%s() error: %s", prefix, errContext.err) -} - -func (errContext *errorContext) IsValid() bool { - return false -} - -func (errContext *errorContext) Line() int { - return -1 -} - -func (errContext *errorContext) Func() string { - return errContext.getErrorText("Func") -} - -func (errContext *errorContext) ShortPath() string { - return errContext.getErrorText("ShortPath") -} - -func (errContext *errorContext) FullPath() string { - return errContext.getErrorText("FullPath") -} - -func (errContext *errorContext) FileName() string { - return errContext.getErrorText("FileName") -} - -func (errContext *errorContext) CallTime() time.Time { - return errContext.errorTime -} - -func (errContext *errorContext) CustomContext() interface{} { - return nil -} diff --git a/vendor/github.com/cihub/seelog/common_exception.go b/vendor/github.com/cihub/seelog/common_exception.go deleted file mode 100644 index 9acc2750..00000000 --- a/vendor/github.com/cihub/seelog/common_exception.go +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "errors" - "fmt" - "regexp" - "strings" -) - -// Used in rules creation to validate input file and func filters -var ( - fileFormatValidator = regexp.MustCompile(`[a-zA-Z0-9\\/ _\*\.]*`) - funcFormatValidator = regexp.MustCompile(`[a-zA-Z0-9_\*\.]*`) -) - -// LogLevelException represents an exceptional case used when you need some specific files or funcs to -// override general constraints and to use their own. -type LogLevelException struct { - funcPatternParts []string - filePatternParts []string - - funcPattern string - filePattern string - - constraints logLevelConstraints -} - -// NewLogLevelException creates a new exception. -func NewLogLevelException(funcPattern string, filePattern string, constraints logLevelConstraints) (*LogLevelException, error) { - if constraints == nil { - return nil, errors.New("constraints can not be nil") - } - - exception := new(LogLevelException) - - err := exception.initFuncPatternParts(funcPattern) - if err != nil { - return nil, err - } - exception.funcPattern = strings.Join(exception.funcPatternParts, "") - - err = exception.initFilePatternParts(filePattern) - if err != nil { - return nil, err - } - exception.filePattern = strings.Join(exception.filePatternParts, "") - - exception.constraints = constraints - - return exception, nil -} - -// MatchesContext returns true if context matches the patterns of this LogLevelException -func (logLevelEx *LogLevelException) MatchesContext(context LogContextInterface) bool { - return logLevelEx.match(context.Func(), context.FullPath()) -} - -// IsAllowed returns true if log level is allowed according to the constraints of this LogLevelException -func (logLevelEx *LogLevelException) IsAllowed(level LogLevel) bool { - return logLevelEx.constraints.IsAllowed(level) -} - -// FuncPattern returns the function pattern of a exception -func (logLevelEx *LogLevelException) FuncPattern() string { - return logLevelEx.funcPattern -} - -// FuncPattern returns the file pattern of a exception -func (logLevelEx *LogLevelException) FilePattern() string { - return logLevelEx.filePattern -} - -// initFuncPatternParts checks whether the func filter has a correct format and splits funcPattern on parts -func (logLevelEx *LogLevelException) initFuncPatternParts(funcPattern string) (err error) { - - if funcFormatValidator.FindString(funcPattern) != funcPattern { - return errors.New("func path \"" + funcPattern + "\" contains incorrect symbols. Only a-z A-Z 0-9 _ * . allowed)") - } - - logLevelEx.funcPatternParts = splitPattern(funcPattern) - return nil -} - -// Checks whether the file filter has a correct format and splits file patterns using splitPattern. -func (logLevelEx *LogLevelException) initFilePatternParts(filePattern string) (err error) { - - if fileFormatValidator.FindString(filePattern) != filePattern { - return errors.New("file path \"" + filePattern + "\" contains incorrect symbols. Only a-z A-Z 0-9 \\ / _ * . allowed)") - } - - logLevelEx.filePatternParts = splitPattern(filePattern) - return err -} - -func (logLevelEx *LogLevelException) match(funcPath string, filePath string) bool { - if !stringMatchesPattern(logLevelEx.funcPatternParts, funcPath) { - return false - } - return stringMatchesPattern(logLevelEx.filePatternParts, filePath) -} - -func (logLevelEx *LogLevelException) String() string { - str := fmt.Sprintf("Func: %s File: %s", logLevelEx.funcPattern, logLevelEx.filePattern) - - if logLevelEx.constraints != nil { - str += fmt.Sprintf("Constr: %s", logLevelEx.constraints) - } else { - str += "nil" - } - - return str -} - -// splitPattern splits pattern into strings and asterisks. Example: "ab*cde**f" -> ["ab", "*", "cde", "*", "f"] -func splitPattern(pattern string) []string { - var patternParts []string - var lastChar rune - for _, char := range pattern { - if char == '*' { - if lastChar != '*' { - patternParts = append(patternParts, "*") - } - } else { - if len(patternParts) != 0 && lastChar != '*' { - patternParts[len(patternParts)-1] += string(char) - } else { - patternParts = append(patternParts, string(char)) - } - } - lastChar = char - } - - return patternParts -} - -// stringMatchesPattern check whether testString matches pattern with asterisks. -// Standard regexp functionality is not used here because of performance issues. -func stringMatchesPattern(patternparts []string, testString string) bool { - if len(patternparts) == 0 { - return len(testString) == 0 - } - - part := patternparts[0] - if part != "*" { - index := strings.Index(testString, part) - if index == 0 { - return stringMatchesPattern(patternparts[1:], testString[len(part):]) - } - } else { - if len(patternparts) == 1 { - return true - } - - newTestString := testString - part = patternparts[1] - for { - index := strings.Index(newTestString, part) - if index == -1 { - break - } - - newTestString = newTestString[index+len(part):] - result := stringMatchesPattern(patternparts[2:], newTestString) - if result { - return true - } - } - } - return false -} diff --git a/vendor/github.com/cihub/seelog/common_flusher.go b/vendor/github.com/cihub/seelog/common_flusher.go deleted file mode 100644 index 0ef077c8..00000000 --- a/vendor/github.com/cihub/seelog/common_flusher.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -// flusherInterface represents all objects that have to do cleanup -// at certain moments of time (e.g. before app shutdown to avoid data loss) -type flusherInterface interface { - Flush() -} diff --git a/vendor/github.com/cihub/seelog/common_loglevel.go b/vendor/github.com/cihub/seelog/common_loglevel.go deleted file mode 100644 index d54ecf27..00000000 --- a/vendor/github.com/cihub/seelog/common_loglevel.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -// Log level type -type LogLevel uint8 - -// Log levels -const ( - TraceLvl = iota - DebugLvl - InfoLvl - WarnLvl - ErrorLvl - CriticalLvl - Off -) - -// Log level string representations (used in configuration files) -const ( - TraceStr = "trace" - DebugStr = "debug" - InfoStr = "info" - WarnStr = "warn" - ErrorStr = "error" - CriticalStr = "critical" - OffStr = "off" -) - -var levelToStringRepresentations = map[LogLevel]string{ - TraceLvl: TraceStr, - DebugLvl: DebugStr, - InfoLvl: InfoStr, - WarnLvl: WarnStr, - ErrorLvl: ErrorStr, - CriticalLvl: CriticalStr, - Off: OffStr, -} - -// LogLevelFromString parses a string and returns a corresponding log level, if sucessfull. -func LogLevelFromString(levelStr string) (level LogLevel, found bool) { - for lvl, lvlStr := range levelToStringRepresentations { - if lvlStr == levelStr { - return lvl, true - } - } - - return 0, false -} - -// LogLevelToString returns seelog string representation for a specified level. Returns "" for invalid log levels. -func (level LogLevel) String() string { - levelStr, ok := levelToStringRepresentations[level] - if ok { - return levelStr - } - - return "" -} diff --git a/vendor/github.com/cihub/seelog/dispatch_custom.go b/vendor/github.com/cihub/seelog/dispatch_custom.go deleted file mode 100644 index 383a7705..00000000 --- a/vendor/github.com/cihub/seelog/dispatch_custom.go +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) 2013 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "errors" - "fmt" - "reflect" - "sort" -) - -var registeredReceivers = make(map[string]reflect.Type) - -// RegisterReceiver records a custom receiver type, identified by a value -// of that type (second argument), under the specified name. Registered -// names can be used in the "name" attribute of config items. -// -// RegisterReceiver takes the type of the receiver argument, without taking -// the value into the account. So do NOT enter any data to the second argument -// and only call it like: -// RegisterReceiver("somename", &MyReceiverType{}) -// -// After that, when a '' config tag with this name is used, -// a receiver of the specified type would be instantiated. Check -// CustomReceiver comments for interface details. -// -// NOTE 1: RegisterReceiver fails if you attempt to register different types -// with the same name. -// -// NOTE 2: RegisterReceiver registers those receivers that must be used in -// the configuration files ( items). Basically it is just the way -// you tell seelog config parser what should it do when it meets a -// tag with a specific name and data attributes. -// -// But If you are only using seelog as a proxy to an already instantiated -// CustomReceiver (via LoggerFromCustomReceiver func), you should not call RegisterReceiver. -func RegisterReceiver(name string, receiver CustomReceiver) { - newType := reflect.TypeOf(reflect.ValueOf(receiver).Elem().Interface()) - if t, ok := registeredReceivers[name]; ok && t != newType { - panic(fmt.Sprintf("duplicate types for %s: %s != %s", name, t, newType)) - } - registeredReceivers[name] = newType -} - -func customReceiverByName(name string) (creceiver CustomReceiver, err error) { - rt, ok := registeredReceivers[name] - if !ok { - return nil, fmt.Errorf("custom receiver name not registered: '%s'", name) - } - v, ok := reflect.New(rt).Interface().(CustomReceiver) - if !ok { - return nil, fmt.Errorf("cannot instantiate receiver with name='%s'", name) - } - return v, nil -} - -// CustomReceiverInitArgs represent arguments passed to the CustomReceiver.Init -// func when custom receiver is being initialized. -type CustomReceiverInitArgs struct { - // XmlCustomAttrs represent '' xml config item attributes that - // start with "data-". Map keys will be the attribute names without the "data-". - // Map values will the those attribute values. - // - // E.g. if you have a '' - // you will get map with 2 key-value pairs: "attr1"->"a1", "attr2"->"a2" - // - // Note that in custom items you can only use allowed attributes, like "name" and - // your custom attributes, starting with "data-". Any other will lead to a - // parsing error. - XmlCustomAttrs map[string]string -} - -// CustomReceiver is the interface that external custom seelog message receivers -// must implement in order to be able to process seelog messages. Those receivers -// are set in the xml config file using the tag. Check receivers reference -// wiki section on that. -// -// Use seelog.RegisterReceiver on the receiver type before using it. -type CustomReceiver interface { - // ReceiveMessage is called when the custom receiver gets seelog message from - // a parent dispatcher. - // - // Message, level and context args represent all data that was included in the seelog - // message at the time it was logged. - // - // The formatting is already applied to the message and depends on the config - // like with any other receiver. - // - // If you would like to inform seelog of an error that happened during the handling of - // the message, return a non-nil error. This way you'll end up seeing your error like - // any other internal seelog error. - ReceiveMessage(message string, level LogLevel, context LogContextInterface) error - - // AfterParse is called immediately after your custom receiver is instantiated by - // the xml config parser. So, if you need to do any startup logic after config parsing, - // like opening file or allocating any resources after the receiver is instantiated, do it here. - // - // If this func returns a non-nil error, then the loading procedure will fail. E.g. - // if you are loading a seelog xml config, the parser would not finish the loading - // procedure and inform about an error like with any other config error. - // - // If your custom logger needs some configuration, you can use custom attributes in - // your config. Check CustomReceiverInitArgs.XmlCustomAttrs comments. - // - // IMPORTANT: This func is NOT called when the LoggerFromCustomReceiver func is used - // to create seelog proxy logger using the custom receiver. This func is only called when - // receiver is instantiated from a config. - AfterParse(initArgs CustomReceiverInitArgs) error - - // Flush is called when the custom receiver gets a 'flush' directive from a - // parent receiver. If custom receiver implements some kind of buffering or - // queing, then the appropriate reaction on a flush message is synchronous - // flushing of all those queues/buffers. If custom receiver doesn't have - // such mechanisms, then flush implementation may be left empty. - Flush() - - // Close is called when the custom receiver gets a 'close' directive from a - // parent receiver. This happens when a top-level seelog dispatcher is sending - // 'close' to all child nodes and it means that current seelog logger is being closed. - // If you need to do any cleanup after your custom receiver is done, you should do - // it here. - Close() error -} - -type customReceiverDispatcher struct { - formatter *formatter - innerReceiver CustomReceiver - customReceiverName string - usedArgs CustomReceiverInitArgs -} - -// NewCustomReceiverDispatcher creates a customReceiverDispatcher which dispatches data to a specific receiver created -// using a tag in the config file. -func NewCustomReceiverDispatcher(formatter *formatter, customReceiverName string, cArgs CustomReceiverInitArgs) (*customReceiverDispatcher, error) { - if formatter == nil { - return nil, errors.New("formatter cannot be nil") - } - if len(customReceiverName) == 0 { - return nil, errors.New("custom receiver name cannot be empty") - } - - creceiver, err := customReceiverByName(customReceiverName) - if err != nil { - return nil, err - } - err = creceiver.AfterParse(cArgs) - if err != nil { - return nil, err - } - disp := &customReceiverDispatcher{formatter, creceiver, customReceiverName, cArgs} - - return disp, nil -} - -// NewCustomReceiverDispatcherByValue is basically the same as NewCustomReceiverDispatcher, but using -// a specific CustomReceiver value instead of instantiating a new one by type. -func NewCustomReceiverDispatcherByValue(formatter *formatter, customReceiver CustomReceiver, name string, cArgs CustomReceiverInitArgs) (*customReceiverDispatcher, error) { - if formatter == nil { - return nil, errors.New("formatter cannot be nil") - } - if customReceiver == nil { - return nil, errors.New("customReceiver cannot be nil") - } - disp := &customReceiverDispatcher{formatter, customReceiver, name, cArgs} - - return disp, nil -} - -// CustomReceiver implementation. Check CustomReceiver comments. -func (disp *customReceiverDispatcher) Dispatch( - message string, - level LogLevel, - context LogContextInterface, - errorFunc func(err error)) { - - defer func() { - if err := recover(); err != nil { - errorFunc(fmt.Errorf("panic in custom receiver '%s'.Dispatch: %s", reflect.TypeOf(disp.innerReceiver), err)) - } - }() - - err := disp.innerReceiver.ReceiveMessage(disp.formatter.Format(message, level, context), level, context) - if err != nil { - errorFunc(err) - } -} - -// CustomReceiver implementation. Check CustomReceiver comments. -func (disp *customReceiverDispatcher) Flush() { - disp.innerReceiver.Flush() -} - -// CustomReceiver implementation. Check CustomReceiver comments. -func (disp *customReceiverDispatcher) Close() error { - disp.innerReceiver.Flush() - - err := disp.innerReceiver.Close() - if err != nil { - return err - } - - return nil -} - -func (disp *customReceiverDispatcher) String() string { - datas := "" - skeys := make([]string, 0, len(disp.usedArgs.XmlCustomAttrs)) - for i := range disp.usedArgs.XmlCustomAttrs { - skeys = append(skeys, i) - } - sort.Strings(skeys) - for _, key := range skeys { - datas += fmt.Sprintf("<%s, %s> ", key, disp.usedArgs.XmlCustomAttrs[key]) - } - - str := fmt.Sprintf("Custom receiver %s [fmt='%s'],[data='%s'],[inner='%s']\n", - disp.customReceiverName, disp.formatter.String(), datas, disp.innerReceiver) - - return str -} diff --git a/vendor/github.com/cihub/seelog/dispatch_dispatcher.go b/vendor/github.com/cihub/seelog/dispatch_dispatcher.go deleted file mode 100644 index 2bd3b4a4..00000000 --- a/vendor/github.com/cihub/seelog/dispatch_dispatcher.go +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "errors" - "fmt" - "io" -) - -// A dispatcherInterface is used to dispatch message to all underlying receivers. -// Dispatch logic depends on given context and log level. Any errors are reported using errorFunc. -// Also, as underlying receivers may have a state, dispatcher has a ShuttingDown method which performs -// an immediate cleanup of all data that is stored in the receivers -type dispatcherInterface interface { - flusherInterface - io.Closer - Dispatch(message string, level LogLevel, context LogContextInterface, errorFunc func(err error)) -} - -type dispatcher struct { - formatter *formatter - writers []*formattedWriter - dispatchers []dispatcherInterface -} - -// Creates a dispatcher which dispatches data to a list of receivers. -// Each receiver should be either a Dispatcher or io.Writer, otherwise an error will be returned -func createDispatcher(formatter *formatter, receivers []interface{}) (*dispatcher, error) { - if formatter == nil { - return nil, errors.New("formatter cannot be nil") - } - if receivers == nil || len(receivers) == 0 { - return nil, errors.New("receivers cannot be nil or empty") - } - - disp := &dispatcher{formatter, make([]*formattedWriter, 0), make([]dispatcherInterface, 0)} - for _, receiver := range receivers { - writer, ok := receiver.(*formattedWriter) - if ok { - disp.writers = append(disp.writers, writer) - continue - } - - ioWriter, ok := receiver.(io.Writer) - if ok { - writer, err := NewFormattedWriter(ioWriter, disp.formatter) - if err != nil { - return nil, err - } - disp.writers = append(disp.writers, writer) - continue - } - - dispInterface, ok := receiver.(dispatcherInterface) - if ok { - disp.dispatchers = append(disp.dispatchers, dispInterface) - continue - } - - return nil, errors.New("method can receive either io.Writer or dispatcherInterface") - } - - return disp, nil -} - -func (disp *dispatcher) Dispatch( - message string, - level LogLevel, - context LogContextInterface, - errorFunc func(err error)) { - - for _, writer := range disp.writers { - err := writer.Write(message, level, context) - if err != nil { - errorFunc(err) - } - } - - for _, dispInterface := range disp.dispatchers { - dispInterface.Dispatch(message, level, context, errorFunc) - } -} - -// Flush goes through all underlying writers which implement flusherInterface interface -// and closes them. Recursively performs the same action for underlying dispatchers -func (disp *dispatcher) Flush() { - for _, disp := range disp.Dispatchers() { - disp.Flush() - } - - for _, formatWriter := range disp.Writers() { - flusher, ok := formatWriter.Writer().(flusherInterface) - if ok { - flusher.Flush() - } - } -} - -// Close goes through all underlying writers which implement io.Closer interface -// and closes them. Recursively performs the same action for underlying dispatchers -// Before closing, writers are flushed to prevent loss of any buffered data, so -// a call to Flush() func before Close() is not necessary -func (disp *dispatcher) Close() error { - for _, disp := range disp.Dispatchers() { - disp.Flush() - err := disp.Close() - if err != nil { - return err - } - } - - for _, formatWriter := range disp.Writers() { - flusher, ok := formatWriter.Writer().(flusherInterface) - if ok { - flusher.Flush() - } - - closer, ok := formatWriter.Writer().(io.Closer) - if ok { - err := closer.Close() - if err != nil { - return err - } - } - } - - return nil -} - -func (disp *dispatcher) Writers() []*formattedWriter { - return disp.writers -} - -func (disp *dispatcher) Dispatchers() []dispatcherInterface { - return disp.dispatchers -} - -func (disp *dispatcher) String() string { - str := "formatter: " + disp.formatter.String() + "\n" - - str += " ->Dispatchers:" - - if len(disp.dispatchers) == 0 { - str += "none\n" - } else { - str += "\n" - - for _, disp := range disp.dispatchers { - str += fmt.Sprintf(" ->%s", disp) - } - } - - str += " ->Writers:" - - if len(disp.writers) == 0 { - str += "none\n" - } else { - str += "\n" - - for _, writer := range disp.writers { - str += fmt.Sprintf(" ->%s\n", writer) - } - } - - return str -} diff --git a/vendor/github.com/cihub/seelog/dispatch_filterdispatcher.go b/vendor/github.com/cihub/seelog/dispatch_filterdispatcher.go deleted file mode 100644 index 9de8a722..00000000 --- a/vendor/github.com/cihub/seelog/dispatch_filterdispatcher.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "fmt" -) - -// A filterDispatcher writes the given message to underlying receivers only if message log level -// is in the allowed list. -type filterDispatcher struct { - *dispatcher - allowList map[LogLevel]bool -} - -// NewFilterDispatcher creates a new filterDispatcher using a list of allowed levels. -func NewFilterDispatcher(formatter *formatter, receivers []interface{}, allowList ...LogLevel) (*filterDispatcher, error) { - disp, err := createDispatcher(formatter, receivers) - if err != nil { - return nil, err - } - - allows := make(map[LogLevel]bool) - for _, allowLevel := range allowList { - allows[allowLevel] = true - } - - return &filterDispatcher{disp, allows}, nil -} - -func (filter *filterDispatcher) Dispatch( - message string, - level LogLevel, - context LogContextInterface, - errorFunc func(err error)) { - isAllowed, ok := filter.allowList[level] - if ok && isAllowed { - filter.dispatcher.Dispatch(message, level, context, errorFunc) - } -} - -func (filter *filterDispatcher) String() string { - return fmt.Sprintf("filterDispatcher ->\n%s", filter.dispatcher) -} diff --git a/vendor/github.com/cihub/seelog/dispatch_splitdispatcher.go b/vendor/github.com/cihub/seelog/dispatch_splitdispatcher.go deleted file mode 100644 index 1d0fe7ea..00000000 --- a/vendor/github.com/cihub/seelog/dispatch_splitdispatcher.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "fmt" -) - -// A splitDispatcher just writes the given message to underlying receivers. (Splits the message stream.) -type splitDispatcher struct { - *dispatcher -} - -func NewSplitDispatcher(formatter *formatter, receivers []interface{}) (*splitDispatcher, error) { - disp, err := createDispatcher(formatter, receivers) - if err != nil { - return nil, err - } - - return &splitDispatcher{disp}, nil -} - -func (splitter *splitDispatcher) String() string { - return fmt.Sprintf("splitDispatcher ->\n%s", splitter.dispatcher.String()) -} diff --git a/vendor/github.com/cihub/seelog/doc.go b/vendor/github.com/cihub/seelog/doc.go deleted file mode 100644 index 2734c9cb..00000000 --- a/vendor/github.com/cihub/seelog/doc.go +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) 2014 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* -Package seelog implements logging functionality with flexible dispatching, filtering, and formatting. - -Creation - -To create a logger, use one of the following constructors: - func LoggerFromConfigAsBytes - func LoggerFromConfigAsFile - func LoggerFromConfigAsString - func LoggerFromWriterWithMinLevel - func LoggerFromWriterWithMinLevelAndFormat - func LoggerFromCustomReceiver (check https://github.com/cihub/seelog/wiki/Custom-receivers) -Example: - import log "github.com/cihub/seelog" - - func main() { - logger, err := log.LoggerFromConfigAsFile("seelog.xml") - if err != nil { - panic(err) - } - defer logger.Flush() - ... use logger ... - } -The "defer" line is important because if you are using asynchronous logger behavior, without this line you may end up losing some -messages when you close your application because they are processed in another non-blocking goroutine. To avoid that you -explicitly defer flushing all messages before closing. - -Usage - -Logger created using one of the LoggerFrom* funcs can be used directly by calling one of the main log funcs. -Example: - import log "github.com/cihub/seelog" - - func main() { - logger, err := log.LoggerFromConfigAsFile("seelog.xml") - if err != nil { - panic(err) - } - defer logger.Flush() - logger.Trace("test") - logger.Debugf("var = %s", "abc") - } - -Having loggers as variables is convenient if you are writing your own package with internal logging or if you have -several loggers with different options. -But for most standalone apps it is more convenient to use package level funcs and vars. There is a package level -var 'Current' made for it. You can replace it with another logger using 'ReplaceLogger' and then use package level funcs: - import log "github.com/cihub/seelog" - - func main() { - logger, err := log.LoggerFromConfigAsFile("seelog.xml") - if err != nil { - panic(err) - } - log.ReplaceLogger(logger) - defer log.Flush() - log.Trace("test") - log.Debugf("var = %s", "abc") - } -Last lines - log.Trace("test") - log.Debugf("var = %s", "abc") -do the same as - log.Current.Trace("test") - log.Current.Debugf("var = %s", "abc") -In this example the 'Current' logger was replaced using a 'ReplaceLogger' call and became equal to 'logger' variable created from config. -This way you are able to use package level funcs instead of passing the logger variable. - -Configuration - -Main seelog point is to configure logger via config files and not the code. -The configuration is read by LoggerFrom* funcs. These funcs read xml configuration from different sources and try -to create a logger using it. - -All the configuration features are covered in detail in the official wiki: https://github.com/cihub/seelog/wiki. -There are many sections covering different aspects of seelog, but the most important for understanding configs are: - https://github.com/cihub/seelog/wiki/Constraints-and-exceptions - https://github.com/cihub/seelog/wiki/Dispatchers-and-receivers - https://github.com/cihub/seelog/wiki/Formatting - https://github.com/cihub/seelog/wiki/Logger-types -After you understand these concepts, check the 'Reference' section on the main wiki page to get the up-to-date -list of dispatchers, receivers, formats, and logger types. - -Here is an example config with all these features: - - - - - - - - - - - - - - - - - - - - - -This config represents a logger with adaptive timeout between log messages (check logger types reference) which -logs to console, all.log, and errors.log depending on the log level. Its output formats also depend on log level. This logger will only -use log level 'debug' and higher (minlevel is set) for all files with names that don't start with 'test'. For files starting with 'test' -this logger prohibits all levels below 'error'. - -Configuration using code - -Although configuration using code is not recommended, it is sometimes needed and it is possible to do with seelog. Basically, what -you need to do to get started is to create constraints, exceptions and a dispatcher tree (same as with config). Most of the New* -functions in this package are used to provide such capabilities. - -Here is an example of configuration in code, that demonstrates an async loop logger that logs to a simple split dispatcher with -a console receiver using a specified format and is filtered using a top-level min-max constraints and one expection for -the 'main.go' file. So, this is basically a demonstration of configuration of most of the features: - - package main - - import log "github.com/cihub/seelog" - - func main() { - defer log.Flush() - log.Info("Hello from Seelog!") - - consoleWriter, _ := log.NewConsoleWriter() - formatter, _ := log.NewFormatter("%Level %Msg %File%n") - root, _ := log.NewSplitDispatcher(formatter, []interface{}{consoleWriter}) - constraints, _ := log.NewMinMaxConstraints(log.TraceLvl, log.CriticalLvl) - specificConstraints, _ := log.NewListConstraints([]log.LogLevel{log.InfoLvl, log.ErrorLvl}) - ex, _ := log.NewLogLevelException("*", "*main.go", specificConstraints) - exceptions := []*log.LogLevelException{ex} - - logger := log.NewAsyncLoopLogger(log.NewLoggerConfig(constraints, exceptions, root)) - log.ReplaceLogger(logger) - - log.Trace("This should not be seen") - log.Debug("This should not be seen") - log.Info("Test") - log.Error("Test2") - } - -Examples - -To learn seelog features faster you should check the examples package: https://github.com/cihub/seelog-examples -It contains many example configs and usecases. -*/ -package seelog diff --git a/vendor/github.com/cihub/seelog/format.go b/vendor/github.com/cihub/seelog/format.go deleted file mode 100644 index ec47b457..00000000 --- a/vendor/github.com/cihub/seelog/format.go +++ /dev/null @@ -1,466 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "bytes" - "errors" - "fmt" - "strconv" - "strings" - "unicode" - "unicode/utf8" -) - -// FormatterSymbol is a special symbol used in config files to mark special format aliases. -const ( - FormatterSymbol = '%' -) - -const ( - formatterParameterStart = '(' - formatterParameterEnd = ')' -) - -// Time and date formats used for %Date and %Time aliases. -const ( - DateDefaultFormat = "2006-01-02" - TimeFormat = "15:04:05" -) - -var DefaultMsgFormat = "%Ns [%Level] %Msg%n" - -var ( - DefaultFormatter *formatter - msgonlyformatter *formatter -) - -func init() { - var err error - if DefaultFormatter, err = NewFormatter(DefaultMsgFormat); err != nil { - reportInternalError(fmt.Errorf("error during creating DefaultFormatter: %s", err)) - } - if msgonlyformatter, err = NewFormatter("%Msg"); err != nil { - reportInternalError(fmt.Errorf("error during creating msgonlyformatter: %s", err)) - } -} - -// FormatterFunc represents one formatter object that starts with '%' sign in the 'format' attribute -// of the 'format' config item. These special symbols are replaced with context values or special -// strings when message is written to byte receiver. -// -// Check https://github.com/cihub/seelog/wiki/Formatting for details. -// Full list (with descriptions) of formatters: https://github.com/cihub/seelog/wiki/Format-reference -// -// FormatterFunc takes raw log message, level, log context and returns a string, number (of any type) or any object -// that can be evaluated as string. -type FormatterFunc func(message string, level LogLevel, context LogContextInterface) interface{} - -// FormatterFuncCreator is a factory of FormatterFunc objects. It is used to generate parameterized -// formatters (such as %Date or %EscM) and custom user formatters. -type FormatterFuncCreator func(param string) FormatterFunc - -var formatterFuncs = map[string]FormatterFunc{ - "Level": formatterLevel, - "Lev": formatterLev, - "LEVEL": formatterLEVEL, - "LEV": formatterLEV, - "l": formatterl, - "Msg": formatterMsg, - "FullPath": formatterFullPath, - "File": formatterFile, - "RelFile": formatterRelFile, - "Func": FormatterFunction, - "FuncShort": FormatterFunctionShort, - "Line": formatterLine, - "Time": formatterTime, - "UTCTime": formatterUTCTime, - "Ns": formatterNs, - "UTCNs": formatterUTCNs, - "r": formatterr, - "n": formattern, - "t": formattert, -} - -var formatterFuncsParameterized = map[string]FormatterFuncCreator{ - "Date": createDateTimeFormatterFunc, - "UTCDate": createUTCDateTimeFormatterFunc, - "EscM": createANSIEscapeFunc, -} - -func errorAliasReserved(name string) error { - return fmt.Errorf("cannot use '%s' as custom formatter name. Name is reserved", name) -} - -// RegisterCustomFormatter registers a new custom formatter factory with a given name. If returned error is nil, -// then this name (prepended by '%' symbol) can be used in 'format' attributes in configuration and -// it will be treated like the standard parameterized formatter identifiers. -// -// RegisterCustomFormatter needs to be called before creating a logger for it to take effect. The general recommendation -// is to call it once in 'init' func of your application or any initializer func. -// -// For usage examples, check https://github.com/cihub/seelog/wiki/Custom-formatters. -// -// Name must only consist of letters (unicode.IsLetter). -// -// Name must not be one of the already registered standard formatter names -// (https://github.com/cihub/seelog/wiki/Format-reference) and previously registered -// custom format names. To avoid any potential name conflicts (in future releases), it is recommended -// to start your custom formatter name with a namespace (e.g. 'MyCompanySomething') or a 'Custom' keyword. -func RegisterCustomFormatter(name string, creator FormatterFuncCreator) error { - if _, ok := formatterFuncs[name]; ok { - return errorAliasReserved(name) - } - if _, ok := formatterFuncsParameterized[name]; ok { - return errorAliasReserved(name) - } - formatterFuncsParameterized[name] = creator - return nil -} - -// formatter is used to write messages in a specific format, inserting such additional data -// as log level, date/time, etc. -type formatter struct { - fmtStringOriginal string - fmtString string - formatterFuncs []FormatterFunc -} - -// NewFormatter creates a new formatter using a format string -func NewFormatter(formatString string) (*formatter, error) { - fmtr := new(formatter) - fmtr.fmtStringOriginal = formatString - if err := buildFormatterFuncs(fmtr); err != nil { - return nil, err - } - return fmtr, nil -} - -func buildFormatterFuncs(formatter *formatter) error { - var ( - fsbuf = new(bytes.Buffer) - fsolm1 = len(formatter.fmtStringOriginal) - 1 - ) - for i := 0; i <= fsolm1; i++ { - if char := formatter.fmtStringOriginal[i]; char != FormatterSymbol { - fsbuf.WriteByte(char) - continue - } - // Check if the index is at the end of the string. - if i == fsolm1 { - return fmt.Errorf("format error: %c cannot be last symbol", FormatterSymbol) - } - // Check if the formatter symbol is doubled and skip it as nonmatching. - if formatter.fmtStringOriginal[i+1] == FormatterSymbol { - fsbuf.WriteRune(FormatterSymbol) - i++ - continue - } - function, ni, err := formatter.extractFormatterFunc(i + 1) - if err != nil { - return err - } - // Append formatting string "%v". - fsbuf.Write([]byte{37, 118}) - i = ni - formatter.formatterFuncs = append(formatter.formatterFuncs, function) - } - formatter.fmtString = fsbuf.String() - return nil -} - -func (formatter *formatter) extractFormatterFunc(index int) (FormatterFunc, int, error) { - letterSequence := formatter.extractLetterSequence(index) - if len(letterSequence) == 0 { - return nil, 0, fmt.Errorf("format error: lack of formatter after %c at %d", FormatterSymbol, index) - } - - function, formatterLength, ok := formatter.findFormatterFunc(letterSequence) - if ok { - return function, index + formatterLength - 1, nil - } - - function, formatterLength, ok, err := formatter.findFormatterFuncParametrized(letterSequence, index) - if err != nil { - return nil, 0, err - } - if ok { - return function, index + formatterLength - 1, nil - } - - return nil, 0, errors.New("format error: unrecognized formatter at " + strconv.Itoa(index) + ": " + letterSequence) -} - -func (formatter *formatter) extractLetterSequence(index int) string { - letters := "" - - bytesToParse := []byte(formatter.fmtStringOriginal[index:]) - runeCount := utf8.RuneCount(bytesToParse) - for i := 0; i < runeCount; i++ { - rune, runeSize := utf8.DecodeRune(bytesToParse) - bytesToParse = bytesToParse[runeSize:] - - if unicode.IsLetter(rune) { - letters += string(rune) - } else { - break - } - } - return letters -} - -func (formatter *formatter) findFormatterFunc(letters string) (FormatterFunc, int, bool) { - currentVerb := letters - for i := 0; i < len(letters); i++ { - function, ok := formatterFuncs[currentVerb] - if ok { - return function, len(currentVerb), ok - } - currentVerb = currentVerb[:len(currentVerb)-1] - } - - return nil, 0, false -} - -func (formatter *formatter) findFormatterFuncParametrized(letters string, lettersStartIndex int) (FormatterFunc, int, bool, error) { - currentVerb := letters - for i := 0; i < len(letters); i++ { - functionCreator, ok := formatterFuncsParameterized[currentVerb] - if ok { - parameter := "" - parameterLen := 0 - isVerbEqualsLetters := i == 0 // if not, then letter goes after formatter, and formatter is parameterless - if isVerbEqualsLetters { - userParameter := "" - var err error - userParameter, parameterLen, ok, err = formatter.findparameter(lettersStartIndex + len(currentVerb)) - if ok { - parameter = userParameter - } else if err != nil { - return nil, 0, false, err - } - } - - return functionCreator(parameter), len(currentVerb) + parameterLen, true, nil - } - - currentVerb = currentVerb[:len(currentVerb)-1] - } - - return nil, 0, false, nil -} - -func (formatter *formatter) findparameter(startIndex int) (string, int, bool, error) { - if len(formatter.fmtStringOriginal) == startIndex || formatter.fmtStringOriginal[startIndex] != formatterParameterStart { - return "", 0, false, nil - } - - endIndex := strings.Index(formatter.fmtStringOriginal[startIndex:], string(formatterParameterEnd)) - if endIndex == -1 { - return "", 0, false, fmt.Errorf("Unmatched parenthesis or invalid parameter at %d: %s", - startIndex, formatter.fmtStringOriginal[startIndex:]) - } - endIndex += startIndex - - length := endIndex - startIndex + 1 - - return formatter.fmtStringOriginal[startIndex+1 : endIndex], length, true, nil -} - -// Format processes a message with special formatters, log level, and context. Returns formatted string -// with all formatter identifiers changed to appropriate values. -func (formatter *formatter) Format(message string, level LogLevel, context LogContextInterface) string { - if len(formatter.formatterFuncs) == 0 { - return formatter.fmtString - } - - params := make([]interface{}, len(formatter.formatterFuncs)) - for i, function := range formatter.formatterFuncs { - params[i] = function(message, level, context) - } - - return fmt.Sprintf(formatter.fmtString, params...) -} - -func (formatter *formatter) String() string { - return formatter.fmtStringOriginal -} - -//===================================================== - -const ( - wrongLogLevel = "WRONG_LOGLEVEL" - wrongEscapeCode = "WRONG_ESCAPE" -) - -var levelToString = map[LogLevel]string{ - TraceLvl: "Trace", - DebugLvl: "Debug", - InfoLvl: "Info", - WarnLvl: "Warn", - ErrorLvl: "Error", - CriticalLvl: "Critical", - Off: "Off", -} - -var levelToShortString = map[LogLevel]string{ - TraceLvl: "Trc", - DebugLvl: "Dbg", - InfoLvl: "Inf", - WarnLvl: "Wrn", - ErrorLvl: "Err", - CriticalLvl: "Crt", - Off: "Off", -} - -var levelToShortestString = map[LogLevel]string{ - TraceLvl: "t", - DebugLvl: "d", - InfoLvl: "i", - WarnLvl: "w", - ErrorLvl: "e", - CriticalLvl: "c", - Off: "o", -} - -func formatterLevel(message string, level LogLevel, context LogContextInterface) interface{} { - levelStr, ok := levelToString[level] - if !ok { - return wrongLogLevel - } - return levelStr -} - -func formatterLev(message string, level LogLevel, context LogContextInterface) interface{} { - levelStr, ok := levelToShortString[level] - if !ok { - return wrongLogLevel - } - return levelStr -} - -func formatterLEVEL(message string, level LogLevel, context LogContextInterface) interface{} { - return strings.ToTitle(formatterLevel(message, level, context).(string)) -} - -func formatterLEV(message string, level LogLevel, context LogContextInterface) interface{} { - return strings.ToTitle(formatterLev(message, level, context).(string)) -} - -func formatterl(message string, level LogLevel, context LogContextInterface) interface{} { - levelStr, ok := levelToShortestString[level] - if !ok { - return wrongLogLevel - } - return levelStr -} - -func formatterMsg(message string, level LogLevel, context LogContextInterface) interface{} { - return message -} - -func formatterFullPath(message string, level LogLevel, context LogContextInterface) interface{} { - return context.FullPath() -} - -func formatterFile(message string, level LogLevel, context LogContextInterface) interface{} { - return context.FileName() -} - -func formatterRelFile(message string, level LogLevel, context LogContextInterface) interface{} { - return context.ShortPath() -} - -func FormatterFunction(message string, level LogLevel, context LogContextInterface) interface{} { - return context.Func() -} - -func FormatterFunctionShort(message string, level LogLevel, context LogContextInterface) interface{} { - f := context.Func() - spl := strings.Split(f, ".") - return spl[len(spl)-1] -} - -func formatterLine(message string, level LogLevel, context LogContextInterface) interface{} { - return context.Line() -} - -func formatterTime(message string, level LogLevel, context LogContextInterface) interface{} { - return context.CallTime().Format(TimeFormat) -} - -func formatterUTCTime(message string, level LogLevel, context LogContextInterface) interface{} { - return context.CallTime().UTC().Format(TimeFormat) -} - -func formatterNs(message string, level LogLevel, context LogContextInterface) interface{} { - return context.CallTime().UnixNano() -} - -func formatterUTCNs(message string, level LogLevel, context LogContextInterface) interface{} { - return context.CallTime().UTC().UnixNano() -} - -func formatterr(message string, level LogLevel, context LogContextInterface) interface{} { - return "\r" -} - -func formattern(message string, level LogLevel, context LogContextInterface) interface{} { - return "\n" -} - -func formattert(message string, level LogLevel, context LogContextInterface) interface{} { - return "\t" -} - -func createDateTimeFormatterFunc(dateTimeFormat string) FormatterFunc { - format := dateTimeFormat - if format == "" { - format = DateDefaultFormat - } - return func(message string, level LogLevel, context LogContextInterface) interface{} { - return context.CallTime().Format(format) - } -} - -func createUTCDateTimeFormatterFunc(dateTimeFormat string) FormatterFunc { - format := dateTimeFormat - if format == "" { - format = DateDefaultFormat - } - return func(message string, level LogLevel, context LogContextInterface) interface{} { - return context.CallTime().UTC().Format(format) - } -} - -func createANSIEscapeFunc(escapeCodeString string) FormatterFunc { - return func(message string, level LogLevel, context LogContextInterface) interface{} { - if len(escapeCodeString) == 0 { - return wrongEscapeCode - } - - return fmt.Sprintf("%c[%sm", 0x1B, escapeCodeString) - } -} diff --git a/vendor/github.com/cihub/seelog/internals_baseerror.go b/vendor/github.com/cihub/seelog/internals_baseerror.go deleted file mode 100644 index c0b271d7..00000000 --- a/vendor/github.com/cihub/seelog/internals_baseerror.go +++ /dev/null @@ -1,10 +0,0 @@ -package seelog - -// Base struct for custom errors. -type baseError struct { - message string -} - -func (be baseError) Error() string { - return be.message -} diff --git a/vendor/github.com/cihub/seelog/internals_fsutils.go b/vendor/github.com/cihub/seelog/internals_fsutils.go deleted file mode 100644 index c0a0e0e4..00000000 --- a/vendor/github.com/cihub/seelog/internals_fsutils.go +++ /dev/null @@ -1,320 +0,0 @@ -package seelog - -import ( - "fmt" - "io" - "os" - "path/filepath" - "sync" -) - -// File and directory permitions. -const ( - defaultFilePermissions = 0666 - defaultDirectoryPermissions = 0767 -) - -const ( - // Max number of directories can be read asynchronously. - maxDirNumberReadAsync = 1000 -) - -type cannotOpenFileError struct { - baseError -} - -func newCannotOpenFileError(fname string) *cannotOpenFileError { - return &cannotOpenFileError{baseError{message: "Cannot open file: " + fname}} -} - -type notDirectoryError struct { - baseError -} - -func newNotDirectoryError(dname string) *notDirectoryError { - return ¬DirectoryError{baseError{message: dname + " is not directory"}} -} - -// fileFilter is a filtering criteria function for '*os.File'. -// Must return 'false' to set aside the given file. -type fileFilter func(os.FileInfo, *os.File) bool - -// filePathFilter is a filtering creteria function for file path. -// Must return 'false' to set aside the given file. -type filePathFilter func(filePath string) bool - -// GetSubdirNames returns a list of directories found in -// the given one with dirPath. -func getSubdirNames(dirPath string) ([]string, error) { - fi, err := os.Stat(dirPath) - if err != nil { - return nil, err - } - if !fi.IsDir() { - return nil, newNotDirectoryError(dirPath) - } - dd, err := os.Open(dirPath) - // Cannot open file. - if err != nil { - if dd != nil { - dd.Close() - } - return nil, err - } - defer dd.Close() - // TODO: Improve performance by buffering reading. - allEntities, err := dd.Readdir(-1) - if err != nil { - return nil, err - } - subDirs := []string{} - for _, entity := range allEntities { - if entity.IsDir() { - subDirs = append(subDirs, entity.Name()) - } - } - return subDirs, nil -} - -// getSubdirAbsPaths recursively visit all the subdirectories -// starting from the given directory and returns absolute paths for them. -func getAllSubdirAbsPaths(dirPath string) (res []string, err error) { - dps, err := getSubdirAbsPaths(dirPath) - if err != nil { - res = []string{} - return - } - res = append(res, dps...) - for _, dp := range dps { - sdps, err := getAllSubdirAbsPaths(dp) - if err != nil { - return []string{}, err - } - res = append(res, sdps...) - } - return -} - -// getSubdirAbsPaths supplies absolute paths for all subdirectiries in a given directory. -// Input: (I1) dirPath - absolute path of a directory in question. -// Out: (O1) - slice of subdir asbolute paths; (O2) - error of the operation. -// Remark: If error (O2) is non-nil then (O1) is nil and vice versa. -func getSubdirAbsPaths(dirPath string) ([]string, error) { - sdns, err := getSubdirNames(dirPath) - if err != nil { - return nil, err - } - rsdns := []string{} - for _, sdn := range sdns { - rsdns = append(rsdns, filepath.Join(dirPath, sdn)) - } - return rsdns, nil -} - -// getOpenFilesInDir supplies a slice of os.File pointers to files located in the directory. -// Remark: Ignores files for which fileFilter returns false -func getOpenFilesInDir(dirPath string, fFilter fileFilter) ([]*os.File, error) { - dfi, err := os.Open(dirPath) - if err != nil { - return nil, newCannotOpenFileError("Cannot open directory " + dirPath) - } - defer dfi.Close() - // Size of read buffer (i.e. chunk of items read at a time). - rbs := 64 - resFiles := []*os.File{} -L: - for { - // Read directory entities by reasonable chuncks - // to prevent overflows on big number of files. - fis, e := dfi.Readdir(rbs) - switch e { - // It's OK. - case nil: - // Do nothing, just continue cycle. - case io.EOF: - break L - // Something went wrong. - default: - return nil, e - } - // THINK: Maybe, use async running. - for _, fi := range fis { - // NB: On Linux this could be a problem as - // there are lots of file types available. - if !fi.IsDir() { - f, e := os.Open(filepath.Join(dirPath, fi.Name())) - if e != nil { - if f != nil { - f.Close() - } - // THINK: Add nil as indicator that a problem occurred. - resFiles = append(resFiles, nil) - continue - } - // Check filter condition. - if fFilter != nil && !fFilter(fi, f) { - continue - } - resFiles = append(resFiles, f) - } - } - } - return resFiles, nil -} - -func isRegular(m os.FileMode) bool { - return m&os.ModeType == 0 -} - -// getDirFilePaths return full paths of the files located in the directory. -// Remark: Ignores files for which fileFilter returns false. -func getDirFilePaths(dirPath string, fpFilter filePathFilter, pathIsName bool) ([]string, error) { - dfi, err := os.Open(dirPath) - if err != nil { - return nil, newCannotOpenFileError("Cannot open directory " + dirPath) - } - defer dfi.Close() - - var absDirPath string - if !filepath.IsAbs(dirPath) { - absDirPath, err = filepath.Abs(dirPath) - if err != nil { - return nil, fmt.Errorf("cannot get absolute path of directory: %s", err.Error()) - } - } else { - absDirPath = dirPath - } - - // TODO: check if dirPath is really directory. - // Size of read buffer (i.e. chunk of items read at a time). - rbs := 2 << 5 - filePaths := []string{} - - var fp string -L: - for { - // Read directory entities by reasonable chuncks - // to prevent overflows on big number of files. - fis, e := dfi.Readdir(rbs) - switch e { - // It's OK. - case nil: - // Do nothing, just continue cycle. - case io.EOF: - break L - // Indicate that something went wrong. - default: - return nil, e - } - // THINK: Maybe, use async running. - for _, fi := range fis { - // NB: Should work on every Windows and non-Windows OS. - if isRegular(fi.Mode()) { - if pathIsName { - fp = fi.Name() - } else { - // Build full path of a file. - fp = filepath.Join(absDirPath, fi.Name()) - } - // Check filter condition. - if fpFilter != nil && !fpFilter(fp) { - continue - } - filePaths = append(filePaths, fp) - } - } - } - return filePaths, nil -} - -// getOpenFilesByDirectoryAsync runs async reading directories 'dirPaths' and inserts pairs -// in map 'filesInDirMap': Key - directory name, value - *os.File slice. -func getOpenFilesByDirectoryAsync( - dirPaths []string, - fFilter fileFilter, - filesInDirMap map[string][]*os.File, -) error { - n := len(dirPaths) - if n > maxDirNumberReadAsync { - return fmt.Errorf("number of input directories to be read exceeded max value %d", maxDirNumberReadAsync) - } - type filesInDirResult struct { - DirName string - Files []*os.File - Error error - } - dirFilesChan := make(chan *filesInDirResult, n) - var wg sync.WaitGroup - // Register n goroutines which are going to do work. - wg.Add(n) - for i := 0; i < n; i++ { - // Launch asynchronously the piece of work. - go func(dirPath string) { - fs, e := getOpenFilesInDir(dirPath, fFilter) - dirFilesChan <- &filesInDirResult{filepath.Base(dirPath), fs, e} - // Mark the current goroutine as finished (work is done). - wg.Done() - }(dirPaths[i]) - } - // Wait for all goroutines to finish their work. - wg.Wait() - // Close the error channel to let for-range clause - // get all the buffered values without blocking and quit in the end. - close(dirFilesChan) - for fidr := range dirFilesChan { - if fidr.Error == nil { - // THINK: What will happen if the key is already present? - filesInDirMap[fidr.DirName] = fidr.Files - } else { - return fidr.Error - } - } - return nil -} - -// fileExists return flag whether a given file exists -// and operation error if an unclassified failure occurs. -func fileExists(path string) (bool, error) { - _, err := os.Stat(path) - if err != nil { - if os.IsNotExist(err) { - return false, nil - } - return false, err - } - return true, nil -} - -// createDirectory makes directory with a given name -// making all parent directories if necessary. -func createDirectory(dirPath string) error { - var dPath string - var err error - if !filepath.IsAbs(dirPath) { - dPath, err = filepath.Abs(dirPath) - if err != nil { - return err - } - } else { - dPath = dirPath - } - exists, err := fileExists(dPath) - if err != nil { - return err - } - if exists { - return nil - } - return os.MkdirAll(dPath, os.ModeDir) -} - -// tryRemoveFile gives a try removing the file -// only ignoring an error when the file does not exist. -func tryRemoveFile(filePath string) (err error) { - err = os.Remove(filePath) - if os.IsNotExist(err) { - err = nil - return - } - return -} diff --git a/vendor/github.com/cihub/seelog/internals_xmlnode.go b/vendor/github.com/cihub/seelog/internals_xmlnode.go deleted file mode 100644 index 98588493..00000000 --- a/vendor/github.com/cihub/seelog/internals_xmlnode.go +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "encoding/xml" - "errors" - "fmt" - "io" - "strings" -) - -type xmlNode struct { - name string - attributes map[string]string - children []*xmlNode - value string -} - -func newNode() *xmlNode { - node := new(xmlNode) - node.children = make([]*xmlNode, 0) - node.attributes = make(map[string]string) - return node -} - -func (node *xmlNode) String() string { - str := fmt.Sprintf("<%s", node.name) - - for attrName, attrVal := range node.attributes { - str += fmt.Sprintf(" %s=\"%s\"", attrName, attrVal) - } - - str += ">" - str += node.value - - if len(node.children) != 0 { - for _, child := range node.children { - str += fmt.Sprintf("%s", child) - } - } - - str += fmt.Sprintf("", node.name) - - return str -} - -func (node *xmlNode) unmarshal(startEl xml.StartElement) error { - node.name = startEl.Name.Local - - for _, v := range startEl.Attr { - _, alreadyExists := node.attributes[v.Name.Local] - if alreadyExists { - return errors.New("tag '" + node.name + "' has duplicated attribute: '" + v.Name.Local + "'") - } - node.attributes[v.Name.Local] = v.Value - } - - return nil -} - -func (node *xmlNode) add(child *xmlNode) { - if node.children == nil { - node.children = make([]*xmlNode, 0) - } - - node.children = append(node.children, child) -} - -func (node *xmlNode) hasChildren() bool { - return node.children != nil && len(node.children) > 0 -} - -//============================================= - -func unmarshalConfig(reader io.Reader) (*xmlNode, error) { - xmlParser := xml.NewDecoder(reader) - - config, err := unmarshalNode(xmlParser, nil) - if err != nil { - return nil, err - } - if config == nil { - return nil, errors.New("xml has no content") - } - - nextConfigEntry, err := unmarshalNode(xmlParser, nil) - if nextConfigEntry != nil { - return nil, errors.New("xml contains more than one root element") - } - - return config, nil -} - -func unmarshalNode(xmlParser *xml.Decoder, curToken xml.Token) (node *xmlNode, err error) { - firstLoop := true - for { - var tok xml.Token - if firstLoop && curToken != nil { - tok = curToken - firstLoop = false - } else { - tok, err = getNextToken(xmlParser) - if err != nil || tok == nil { - return - } - } - - switch tt := tok.(type) { - case xml.SyntaxError: - err = errors.New(tt.Error()) - return - case xml.CharData: - value := strings.TrimSpace(string([]byte(tt))) - if node != nil { - node.value += value - } - case xml.StartElement: - if node == nil { - node = newNode() - err := node.unmarshal(tt) - if err != nil { - return nil, err - } - } else { - childNode, childErr := unmarshalNode(xmlParser, tok) - if childErr != nil { - return nil, childErr - } - - if childNode != nil { - node.add(childNode) - } else { - return - } - } - case xml.EndElement: - return - } - } -} - -func getNextToken(xmlParser *xml.Decoder) (tok xml.Token, err error) { - if tok, err = xmlParser.Token(); err != nil { - if err == io.EOF { - err = nil - return - } - return - } - - return -} diff --git a/vendor/github.com/cihub/seelog/log.go b/vendor/github.com/cihub/seelog/log.go deleted file mode 100644 index f775e1fd..00000000 --- a/vendor/github.com/cihub/seelog/log.go +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "errors" - "fmt" - "sync" - "time" -) - -const ( - staticFuncCallDepth = 3 // See 'commonLogger.log' method comments - loggerFuncCallDepth = 3 -) - -// Current is the logger used in all package level convenience funcs like 'Trace', 'Debug', 'Flush', etc. -var Current LoggerInterface - -// Default logger that is created from an empty config: "". It is not closed by a ReplaceLogger call. -var Default LoggerInterface - -// Disabled logger that doesn't produce any output in any circumstances. It is neither closed nor flushed by a ReplaceLogger call. -var Disabled LoggerInterface - -var pkgOperationsMutex *sync.Mutex - -func init() { - pkgOperationsMutex = new(sync.Mutex) - var err error - - if Default == nil { - Default, err = LoggerFromConfigAsBytes([]byte("")) - } - - if Disabled == nil { - Disabled, err = LoggerFromConfigAsBytes([]byte("")) - } - - if err != nil { - panic(fmt.Sprintf("Seelog couldn't start. Error: %s", err.Error())) - } - - Current = Default -} - -func createLoggerFromFullConfig(config *configForParsing) (LoggerInterface, error) { - if config.LogType == syncloggerTypeFromString { - return NewSyncLogger(&config.logConfig), nil - } else if config.LogType == asyncLooploggerTypeFromString { - return NewAsyncLoopLogger(&config.logConfig), nil - } else if config.LogType == asyncTimerloggerTypeFromString { - logData := config.LoggerData - if logData == nil { - return nil, errors.New("async timer data not set") - } - - asyncInt, ok := logData.(asyncTimerLoggerData) - if !ok { - return nil, errors.New("invalid async timer data") - } - - logger, err := NewAsyncTimerLogger(&config.logConfig, time.Duration(asyncInt.AsyncInterval)) - if !ok { - return nil, err - } - - return logger, nil - } else if config.LogType == adaptiveLoggerTypeFromString { - logData := config.LoggerData - if logData == nil { - return nil, errors.New("adaptive logger parameters not set") - } - - adaptData, ok := logData.(adaptiveLoggerData) - if !ok { - return nil, errors.New("invalid adaptive logger parameters") - } - - logger, err := NewAsyncAdaptiveLogger( - &config.logConfig, - time.Duration(adaptData.MinInterval), - time.Duration(adaptData.MaxInterval), - adaptData.CriticalMsgCount, - ) - if err != nil { - return nil, err - } - - return logger, nil - } - return nil, errors.New("invalid config log type/data") -} - -// UseLogger sets the 'Current' package level logger variable to the specified value. -// This variable is used in all Trace/Debug/... package level convenience funcs. -// -// Example: -// -// after calling -// seelog.UseLogger(somelogger) -// the following: -// seelog.Debug("abc") -// will be equal to -// somelogger.Debug("abc") -// -// IMPORTANT: UseLogger do NOT close the previous logger (only flushes it). So if -// you constantly use it to replace loggers and don't close them in other code, you'll -// end up having memory leaks. -// -// To safely replace loggers, use ReplaceLogger. -func UseLogger(logger LoggerInterface) error { - if logger == nil { - return errors.New("logger can not be nil") - } - - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - - oldLogger := Current - Current = logger - - if oldLogger != nil { - oldLogger.Flush() - } - - return nil -} - -// ReplaceLogger acts as UseLogger but the logger that was previously -// used is disposed (except Default and Disabled loggers). -// -// Example: -// import log "github.com/cihub/seelog" -// -// func main() { -// logger, err := log.LoggerFromConfigAsFile("seelog.xml") -// -// if err != nil { -// panic(err) -// } -// -// log.ReplaceLogger(logger) -// defer log.Flush() -// -// log.Trace("test") -// log.Debugf("var = %s", "abc") -// } -func ReplaceLogger(logger LoggerInterface) error { - if logger == nil { - return errors.New("logger can not be nil") - } - - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - - defer func() { - if err := recover(); err != nil { - reportInternalError(fmt.Errorf("recovered from panic during ReplaceLogger: %s", err)) - } - }() - - if Current == Default { - Current.Flush() - } else if Current != nil && !Current.Closed() && Current != Disabled { - Current.Flush() - Current.Close() - } - - Current = logger - - return nil -} - -// Tracef formats message according to format specifier -// and writes to default logger with log level = Trace. -func Tracef(format string, params ...interface{}) { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - Current.traceWithCallDepth(staticFuncCallDepth, newLogFormattedMessage(format, params)) -} - -// Debugf formats message according to format specifier -// and writes to default logger with log level = Debug. -func Debugf(format string, params ...interface{}) { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - Current.debugWithCallDepth(staticFuncCallDepth, newLogFormattedMessage(format, params)) -} - -// Infof formats message according to format specifier -// and writes to default logger with log level = Info. -func Infof(format string, params ...interface{}) { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - Current.infoWithCallDepth(staticFuncCallDepth, newLogFormattedMessage(format, params)) -} - -// Warnf formats message according to format specifier and writes to default logger with log level = Warn -func Warnf(format string, params ...interface{}) error { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - message := newLogFormattedMessage(format, params) - Current.warnWithCallDepth(staticFuncCallDepth, message) - return errors.New(message.String()) -} - -// Errorf formats message according to format specifier and writes to default logger with log level = Error -func Errorf(format string, params ...interface{}) error { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - message := newLogFormattedMessage(format, params) - Current.errorWithCallDepth(staticFuncCallDepth, message) - return errors.New(message.String()) -} - -// Criticalf formats message according to format specifier and writes to default logger with log level = Critical -func Criticalf(format string, params ...interface{}) error { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - message := newLogFormattedMessage(format, params) - Current.criticalWithCallDepth(staticFuncCallDepth, message) - return errors.New(message.String()) -} - -// Trace formats message using the default formats for its operands and writes to default logger with log level = Trace -func Trace(v ...interface{}) { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - Current.traceWithCallDepth(staticFuncCallDepth, newLogMessage(v)) -} - -// Debug formats message using the default formats for its operands and writes to default logger with log level = Debug -func Debug(v ...interface{}) { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - Current.debugWithCallDepth(staticFuncCallDepth, newLogMessage(v)) -} - -// Info formats message using the default formats for its operands and writes to default logger with log level = Info -func Info(v ...interface{}) { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - Current.infoWithCallDepth(staticFuncCallDepth, newLogMessage(v)) -} - -// Warn formats message using the default formats for its operands and writes to default logger with log level = Warn -func Warn(v ...interface{}) error { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - message := newLogMessage(v) - Current.warnWithCallDepth(staticFuncCallDepth, message) - return errors.New(message.String()) -} - -// Error formats message using the default formats for its operands and writes to default logger with log level = Error -func Error(v ...interface{}) error { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - message := newLogMessage(v) - Current.errorWithCallDepth(staticFuncCallDepth, message) - return errors.New(message.String()) -} - -// Critical formats message using the default formats for its operands and writes to default logger with log level = Critical -func Critical(v ...interface{}) error { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - message := newLogMessage(v) - Current.criticalWithCallDepth(staticFuncCallDepth, message) - return errors.New(message.String()) -} - -// Flush immediately processes all currently queued messages and all currently buffered messages. -// It is a blocking call which returns only after the queue is empty and all the buffers are empty. -// -// If Flush is called for a synchronous logger (type='sync'), it only flushes buffers (e.g. '' receivers) -// , because there is no queue. -// -// Call this method when your app is going to shut down not to lose any log messages. -func Flush() { - pkgOperationsMutex.Lock() - defer pkgOperationsMutex.Unlock() - Current.Flush() -} diff --git a/vendor/github.com/cihub/seelog/logger.go b/vendor/github.com/cihub/seelog/logger.go deleted file mode 100644 index fc96aed4..00000000 --- a/vendor/github.com/cihub/seelog/logger.go +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "errors" - "fmt" - "os" - "sync" -) - -func reportInternalError(err error) { - fmt.Fprintf(os.Stderr, "seelog internal error: %s\n", err) -} - -// LoggerInterface represents structs capable of logging Seelog messages -type LoggerInterface interface { - - // Tracef formats message according to format specifier - // and writes to log with level = Trace. - Tracef(format string, params ...interface{}) - - // Debugf formats message according to format specifier - // and writes to log with level = Debug. - Debugf(format string, params ...interface{}) - - // Infof formats message according to format specifier - // and writes to log with level = Info. - Infof(format string, params ...interface{}) - - // Warnf formats message according to format specifier - // and writes to log with level = Warn. - Warnf(format string, params ...interface{}) error - - // Errorf formats message according to format specifier - // and writes to log with level = Error. - Errorf(format string, params ...interface{}) error - - // Criticalf formats message according to format specifier - // and writes to log with level = Critical. - Criticalf(format string, params ...interface{}) error - - // Trace formats message using the default formats for its operands - // and writes to log with level = Trace - Trace(v ...interface{}) - - // Debug formats message using the default formats for its operands - // and writes to log with level = Debug - Debug(v ...interface{}) - - // Info formats message using the default formats for its operands - // and writes to log with level = Info - Info(v ...interface{}) - - // Warn formats message using the default formats for its operands - // and writes to log with level = Warn - Warn(v ...interface{}) error - - // Error formats message using the default formats for its operands - // and writes to log with level = Error - Error(v ...interface{}) error - - // Critical formats message using the default formats for its operands - // and writes to log with level = Critical - Critical(v ...interface{}) error - - traceWithCallDepth(callDepth int, message fmt.Stringer) - debugWithCallDepth(callDepth int, message fmt.Stringer) - infoWithCallDepth(callDepth int, message fmt.Stringer) - warnWithCallDepth(callDepth int, message fmt.Stringer) - errorWithCallDepth(callDepth int, message fmt.Stringer) - criticalWithCallDepth(callDepth int, message fmt.Stringer) - - // Close flushes all the messages in the logger and closes it. It cannot be used after this operation. - Close() - - // Flush flushes all the messages in the logger. - Flush() - - // Closed returns true if the logger was previously closed. - Closed() bool - - // SetAdditionalStackDepth sets the additional number of frames to skip by runtime.Caller - // when getting function information needed to print seelog format identifiers such as %Func or %File. - // - // This func may be used when you wrap seelog funcs and want to print caller info of you own - // wrappers instead of seelog func callers. In this case you should set depth = 1. If you then - // wrap your wrapper, you should set depth = 2, etc. - // - // NOTE: Incorrect depth value may lead to errors in runtime.Caller evaluation or incorrect - // function/file names in log files. Do not use it if you are not going to wrap seelog funcs. - // You may reset the value to default using a SetAdditionalStackDepth(0) call. - SetAdditionalStackDepth(depth int) error - - // Sets logger context that can be used in formatter funcs and custom receivers - SetContext(context interface{}) -} - -// innerLoggerInterface is an internal logging interface -type innerLoggerInterface interface { - innerLog(level LogLevel, context LogContextInterface, message fmt.Stringer) - Flush() -} - -// [file path][func name][level] -> [allowed] -type allowedContextCache map[string]map[string]map[LogLevel]bool - -// commonLogger contains all common data needed for logging and contains methods used to log messages. -type commonLogger struct { - config *logConfig // Config used for logging - contextCache allowedContextCache // Caches whether log is enabled for specific "full path-func name-level" sets - closed bool // 'true' when all writers are closed, all data is flushed, logger is unusable. Must be accessed while holding closedM - closedM sync.RWMutex - m sync.Mutex // Mutex for main operations - unusedLevels []bool - innerLogger innerLoggerInterface - addStackDepth int // Additional stack depth needed for correct seelog caller context detection - customContext interface{} -} - -func newCommonLogger(config *logConfig, internalLogger innerLoggerInterface) *commonLogger { - cLogger := new(commonLogger) - - cLogger.config = config - cLogger.contextCache = make(allowedContextCache) - cLogger.unusedLevels = make([]bool, Off) - cLogger.fillUnusedLevels() - cLogger.innerLogger = internalLogger - - return cLogger -} - -func (cLogger *commonLogger) SetAdditionalStackDepth(depth int) error { - if depth < 0 { - return fmt.Errorf("negative depth: %d", depth) - } - cLogger.m.Lock() - cLogger.addStackDepth = depth - cLogger.m.Unlock() - return nil -} - -func (cLogger *commonLogger) Tracef(format string, params ...interface{}) { - cLogger.traceWithCallDepth(loggerFuncCallDepth, newLogFormattedMessage(format, params)) -} - -func (cLogger *commonLogger) Debugf(format string, params ...interface{}) { - cLogger.debugWithCallDepth(loggerFuncCallDepth, newLogFormattedMessage(format, params)) -} - -func (cLogger *commonLogger) Infof(format string, params ...interface{}) { - cLogger.infoWithCallDepth(loggerFuncCallDepth, newLogFormattedMessage(format, params)) -} - -func (cLogger *commonLogger) Warnf(format string, params ...interface{}) error { - message := newLogFormattedMessage(format, params) - cLogger.warnWithCallDepth(loggerFuncCallDepth, message) - return errors.New(message.String()) -} - -func (cLogger *commonLogger) Errorf(format string, params ...interface{}) error { - message := newLogFormattedMessage(format, params) - cLogger.errorWithCallDepth(loggerFuncCallDepth, message) - return errors.New(message.String()) -} - -func (cLogger *commonLogger) Criticalf(format string, params ...interface{}) error { - message := newLogFormattedMessage(format, params) - cLogger.criticalWithCallDepth(loggerFuncCallDepth, message) - return errors.New(message.String()) -} - -func (cLogger *commonLogger) Trace(v ...interface{}) { - cLogger.traceWithCallDepth(loggerFuncCallDepth, newLogMessage(v)) -} - -func (cLogger *commonLogger) Debug(v ...interface{}) { - cLogger.debugWithCallDepth(loggerFuncCallDepth, newLogMessage(v)) -} - -func (cLogger *commonLogger) Info(v ...interface{}) { - cLogger.infoWithCallDepth(loggerFuncCallDepth, newLogMessage(v)) -} - -func (cLogger *commonLogger) Warn(v ...interface{}) error { - message := newLogMessage(v) - cLogger.warnWithCallDepth(loggerFuncCallDepth, message) - return errors.New(message.String()) -} - -func (cLogger *commonLogger) Error(v ...interface{}) error { - message := newLogMessage(v) - cLogger.errorWithCallDepth(loggerFuncCallDepth, message) - return errors.New(message.String()) -} - -func (cLogger *commonLogger) Critical(v ...interface{}) error { - message := newLogMessage(v) - cLogger.criticalWithCallDepth(loggerFuncCallDepth, message) - return errors.New(message.String()) -} - -func (cLogger *commonLogger) SetContext(c interface{}) { - cLogger.customContext = c -} - -func (cLogger *commonLogger) traceWithCallDepth(callDepth int, message fmt.Stringer) { - cLogger.log(TraceLvl, message, callDepth) -} - -func (cLogger *commonLogger) debugWithCallDepth(callDepth int, message fmt.Stringer) { - cLogger.log(DebugLvl, message, callDepth) -} - -func (cLogger *commonLogger) infoWithCallDepth(callDepth int, message fmt.Stringer) { - cLogger.log(InfoLvl, message, callDepth) -} - -func (cLogger *commonLogger) warnWithCallDepth(callDepth int, message fmt.Stringer) { - cLogger.log(WarnLvl, message, callDepth) -} - -func (cLogger *commonLogger) errorWithCallDepth(callDepth int, message fmt.Stringer) { - cLogger.log(ErrorLvl, message, callDepth) -} - -func (cLogger *commonLogger) criticalWithCallDepth(callDepth int, message fmt.Stringer) { - cLogger.log(CriticalLvl, message, callDepth) - cLogger.innerLogger.Flush() -} - -func (cLogger *commonLogger) Closed() bool { - cLogger.closedM.RLock() - defer cLogger.closedM.RUnlock() - return cLogger.closed -} - -func (cLogger *commonLogger) fillUnusedLevels() { - for i := 0; i < len(cLogger.unusedLevels); i++ { - cLogger.unusedLevels[i] = true - } - - cLogger.fillUnusedLevelsByContraint(cLogger.config.Constraints) - - for _, exception := range cLogger.config.Exceptions { - cLogger.fillUnusedLevelsByContraint(exception) - } -} - -func (cLogger *commonLogger) fillUnusedLevelsByContraint(constraint logLevelConstraints) { - for i := 0; i < len(cLogger.unusedLevels); i++ { - if constraint.IsAllowed(LogLevel(i)) { - cLogger.unusedLevels[i] = false - } - } -} - -// stackCallDepth is used to indicate the call depth of 'log' func. -// This depth level is used in the runtime.Caller(...) call. See -// common_context.go -> specifyContext, extractCallerInfo for details. -func (cLogger *commonLogger) log(level LogLevel, message fmt.Stringer, stackCallDepth int) { - if cLogger.unusedLevels[level] { - return - } - cLogger.m.Lock() - defer cLogger.m.Unlock() - - if cLogger.Closed() { - return - } - context, _ := specifyContext(stackCallDepth+cLogger.addStackDepth, cLogger.customContext) - // Context errors are not reported because there are situations - // in which context errors are normal Seelog usage cases. For - // example in executables with stripped symbols. - // Error contexts are returned instead. See common_context.go. - /*if err != nil { - reportInternalError(err) - return - }*/ - cLogger.innerLogger.innerLog(level, context, message) -} - -func (cLogger *commonLogger) processLogMsg(level LogLevel, message fmt.Stringer, context LogContextInterface) { - defer func() { - if err := recover(); err != nil { - reportInternalError(fmt.Errorf("recovered from panic during message processing: %s", err)) - } - }() - if cLogger.config.IsAllowed(level, context) { - cLogger.config.RootDispatcher.Dispatch(message.String(), level, context, reportInternalError) - } -} - -func (cLogger *commonLogger) isAllowed(level LogLevel, context LogContextInterface) bool { - funcMap, ok := cLogger.contextCache[context.FullPath()] - if !ok { - funcMap = make(map[string]map[LogLevel]bool, 0) - cLogger.contextCache[context.FullPath()] = funcMap - } - - levelMap, ok := funcMap[context.Func()] - if !ok { - levelMap = make(map[LogLevel]bool, 0) - funcMap[context.Func()] = levelMap - } - - isAllowValue, ok := levelMap[level] - if !ok { - isAllowValue = cLogger.config.IsAllowed(level, context) - levelMap[level] = isAllowValue - } - - return isAllowValue -} - -type logMessage struct { - params []interface{} -} - -type logFormattedMessage struct { - format string - params []interface{} -} - -func newLogMessage(params []interface{}) fmt.Stringer { - message := new(logMessage) - - message.params = params - - return message -} - -func newLogFormattedMessage(format string, params []interface{}) *logFormattedMessage { - message := new(logFormattedMessage) - - message.params = params - message.format = format - - return message -} - -func (message *logMessage) String() string { - return fmt.Sprint(message.params...) -} - -func (message *logFormattedMessage) String() string { - return fmt.Sprintf(message.format, message.params...) -} diff --git a/vendor/github.com/cihub/seelog/writers_bufferedwriter.go b/vendor/github.com/cihub/seelog/writers_bufferedwriter.go deleted file mode 100644 index 37d75c82..00000000 --- a/vendor/github.com/cihub/seelog/writers_bufferedwriter.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "bufio" - "errors" - "fmt" - "io" - "sync" - "time" -) - -// bufferedWriter stores data in memory and flushes it every flushPeriod or when buffer is full -type bufferedWriter struct { - flushPeriod time.Duration // data flushes interval (in microseconds) - bufferMutex *sync.Mutex // mutex for buffer operations syncronization - innerWriter io.Writer // inner writer - buffer *bufio.Writer // buffered wrapper for inner writer - bufferSize int // max size of data chunk in bytes -} - -// NewBufferedWriter creates a new buffered writer struct. -// bufferSize -- size of memory buffer in bytes -// flushPeriod -- period in which data flushes from memory buffer in milliseconds. 0 - turn off this functionality -func NewBufferedWriter(innerWriter io.Writer, bufferSize int, flushPeriod time.Duration) (*bufferedWriter, error) { - - if innerWriter == nil { - return nil, errors.New("argument is nil: innerWriter") - } - if flushPeriod < 0 { - return nil, fmt.Errorf("flushPeriod can not be less than 0. Got: %d", flushPeriod) - } - - if bufferSize <= 0 { - return nil, fmt.Errorf("bufferSize can not be less or equal to 0. Got: %d", bufferSize) - } - - buffer := bufio.NewWriterSize(innerWriter, bufferSize) - - /*if err != nil { - return nil, err - }*/ - - newWriter := new(bufferedWriter) - - newWriter.innerWriter = innerWriter - newWriter.buffer = buffer - newWriter.bufferSize = bufferSize - newWriter.flushPeriod = flushPeriod * 1e6 - newWriter.bufferMutex = new(sync.Mutex) - - if flushPeriod != 0 { - go newWriter.flushPeriodically() - } - - return newWriter, nil -} - -func (bufWriter *bufferedWriter) writeBigChunk(bytes []byte) (n int, err error) { - bufferedLen := bufWriter.buffer.Buffered() - - n, err = bufWriter.flushInner() - if err != nil { - return - } - - written, writeErr := bufWriter.innerWriter.Write(bytes) - return bufferedLen + written, writeErr -} - -// Sends data to buffer manager. Waits until all buffers are full. -func (bufWriter *bufferedWriter) Write(bytes []byte) (n int, err error) { - - bufWriter.bufferMutex.Lock() - defer bufWriter.bufferMutex.Unlock() - - bytesLen := len(bytes) - - if bytesLen > bufWriter.bufferSize { - return bufWriter.writeBigChunk(bytes) - } - - if bytesLen > bufWriter.buffer.Available() { - n, err = bufWriter.flushInner() - if err != nil { - return - } - } - - bufWriter.buffer.Write(bytes) - - return len(bytes), nil -} - -func (bufWriter *bufferedWriter) Close() error { - closer, ok := bufWriter.innerWriter.(io.Closer) - if ok { - return closer.Close() - } - - return nil -} - -func (bufWriter *bufferedWriter) Flush() { - - bufWriter.bufferMutex.Lock() - defer bufWriter.bufferMutex.Unlock() - - bufWriter.flushInner() -} - -func (bufWriter *bufferedWriter) flushInner() (n int, err error) { - bufferedLen := bufWriter.buffer.Buffered() - flushErr := bufWriter.buffer.Flush() - - return bufWriter.buffer.Buffered() - bufferedLen, flushErr -} - -func (bufWriter *bufferedWriter) flushBuffer() { - bufWriter.bufferMutex.Lock() - defer bufWriter.bufferMutex.Unlock() - - bufWriter.buffer.Flush() -} - -func (bufWriter *bufferedWriter) flushPeriodically() { - if bufWriter.flushPeriod > 0 { - ticker := time.NewTicker(bufWriter.flushPeriod) - for { - <-ticker.C - bufWriter.flushBuffer() - } - } -} - -func (bufWriter *bufferedWriter) String() string { - return fmt.Sprintf("bufferedWriter size: %d, flushPeriod: %d", bufWriter.bufferSize, bufWriter.flushPeriod) -} diff --git a/vendor/github.com/cihub/seelog/writers_connwriter.go b/vendor/github.com/cihub/seelog/writers_connwriter.go deleted file mode 100644 index d199894e..00000000 --- a/vendor/github.com/cihub/seelog/writers_connwriter.go +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "crypto/tls" - "fmt" - "io" - "net" -) - -// connWriter is used to write to a stream-oriented network connection. -type connWriter struct { - innerWriter io.WriteCloser - reconnectOnMsg bool - reconnect bool - net string - addr string - useTLS bool - configTLS *tls.Config -} - -// Creates writer to the address addr on the network netName. -// Connection will be opened on each write if reconnectOnMsg = true -func NewConnWriter(netName string, addr string, reconnectOnMsg bool) *connWriter { - newWriter := new(connWriter) - - newWriter.net = netName - newWriter.addr = addr - newWriter.reconnectOnMsg = reconnectOnMsg - - return newWriter -} - -// Creates a writer that uses SSL/TLS -func newTLSWriter(netName string, addr string, reconnectOnMsg bool, config *tls.Config) *connWriter { - newWriter := new(connWriter) - - newWriter.net = netName - newWriter.addr = addr - newWriter.reconnectOnMsg = reconnectOnMsg - newWriter.useTLS = true - newWriter.configTLS = config - - return newWriter -} - -func (connWriter *connWriter) Close() error { - if connWriter.innerWriter == nil { - return nil - } - - return connWriter.innerWriter.Close() -} - -func (connWriter *connWriter) Write(bytes []byte) (n int, err error) { - if connWriter.neededConnectOnMsg() { - err = connWriter.connect() - if err != nil { - return 0, err - } - } - - if connWriter.reconnectOnMsg { - defer connWriter.innerWriter.Close() - } - - n, err = connWriter.innerWriter.Write(bytes) - if err != nil { - connWriter.reconnect = true - } - - return -} - -func (connWriter *connWriter) String() string { - return fmt.Sprintf("Conn writer: [%s, %s, %v]", connWriter.net, connWriter.addr, connWriter.reconnectOnMsg) -} - -func (connWriter *connWriter) connect() error { - if connWriter.innerWriter != nil { - connWriter.innerWriter.Close() - connWriter.innerWriter = nil - } - - if connWriter.useTLS { - conn, err := tls.Dial(connWriter.net, connWriter.addr, connWriter.configTLS) - if err != nil { - return err - } - connWriter.innerWriter = conn - - return nil - } - - conn, err := net.Dial(connWriter.net, connWriter.addr) - if err != nil { - return err - } - - tcpConn, ok := conn.(*net.TCPConn) - if ok { - tcpConn.SetKeepAlive(true) - } - - connWriter.innerWriter = conn - - return nil -} - -func (connWriter *connWriter) neededConnectOnMsg() bool { - if connWriter.reconnect { - connWriter.reconnect = false - return true - } - - if connWriter.innerWriter == nil { - return true - } - - return connWriter.reconnectOnMsg -} diff --git a/vendor/github.com/cihub/seelog/writers_consolewriter.go b/vendor/github.com/cihub/seelog/writers_consolewriter.go deleted file mode 100644 index 3eb79afa..00000000 --- a/vendor/github.com/cihub/seelog/writers_consolewriter.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import "fmt" - -// consoleWriter is used to write to console -type consoleWriter struct { -} - -// Creates a new console writer. Returns error, if the console writer couldn't be created. -func NewConsoleWriter() (writer *consoleWriter, err error) { - newWriter := new(consoleWriter) - - return newWriter, nil -} - -// Create folder and file on WriteLog/Write first call -func (console *consoleWriter) Write(bytes []byte) (int, error) { - return fmt.Print(string(bytes)) -} - -func (console *consoleWriter) String() string { - return "Console writer" -} diff --git a/vendor/github.com/cihub/seelog/writers_filewriter.go b/vendor/github.com/cihub/seelog/writers_filewriter.go deleted file mode 100644 index 8d3ae270..00000000 --- a/vendor/github.com/cihub/seelog/writers_filewriter.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "fmt" - "io" - "os" - "path/filepath" -) - -// fileWriter is used to write to a file. -type fileWriter struct { - innerWriter io.WriteCloser - fileName string -} - -// Creates a new file and a corresponding writer. Returns error, if the file couldn't be created. -func NewFileWriter(fileName string) (writer *fileWriter, err error) { - newWriter := new(fileWriter) - newWriter.fileName = fileName - - return newWriter, nil -} - -func (fw *fileWriter) Close() error { - if fw.innerWriter != nil { - err := fw.innerWriter.Close() - if err != nil { - return err - } - fw.innerWriter = nil - } - return nil -} - -// Create folder and file on WriteLog/Write first call -func (fw *fileWriter) Write(bytes []byte) (n int, err error) { - if fw.innerWriter == nil { - if err := fw.createFile(); err != nil { - return 0, err - } - } - return fw.innerWriter.Write(bytes) -} - -func (fw *fileWriter) createFile() error { - folder, _ := filepath.Split(fw.fileName) - var err error - - if 0 != len(folder) { - err = os.MkdirAll(folder, defaultDirectoryPermissions) - if err != nil { - return err - } - } - - // If exists - fw.innerWriter, err = os.OpenFile(fw.fileName, os.O_WRONLY|os.O_APPEND|os.O_CREATE, defaultFilePermissions) - - if err != nil { - return err - } - - return nil -} - -func (fw *fileWriter) String() string { - return fmt.Sprintf("File writer: %s", fw.fileName) -} diff --git a/vendor/github.com/cihub/seelog/writers_formattedwriter.go b/vendor/github.com/cihub/seelog/writers_formattedwriter.go deleted file mode 100644 index bf44a410..00000000 --- a/vendor/github.com/cihub/seelog/writers_formattedwriter.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "errors" - "fmt" - "io" -) - -type formattedWriter struct { - writer io.Writer - formatter *formatter -} - -func NewFormattedWriter(writer io.Writer, formatter *formatter) (*formattedWriter, error) { - if formatter == nil { - return nil, errors.New("formatter can not be nil") - } - - return &formattedWriter{writer, formatter}, nil -} - -func (formattedWriter *formattedWriter) Write(message string, level LogLevel, context LogContextInterface) error { - str := formattedWriter.formatter.Format(message, level, context) - _, err := formattedWriter.writer.Write([]byte(str)) - return err -} - -func (formattedWriter *formattedWriter) String() string { - return fmt.Sprintf("writer: %s, format: %s", formattedWriter.writer, formattedWriter.formatter) -} - -func (formattedWriter *formattedWriter) Writer() io.Writer { - return formattedWriter.writer -} - -func (formattedWriter *formattedWriter) Format() *formatter { - return formattedWriter.formatter -} diff --git a/vendor/github.com/cihub/seelog/writers_rollingfilewriter.go b/vendor/github.com/cihub/seelog/writers_rollingfilewriter.go deleted file mode 100644 index 9535a579..00000000 --- a/vendor/github.com/cihub/seelog/writers_rollingfilewriter.go +++ /dev/null @@ -1,763 +0,0 @@ -// Copyright (c) 2013 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "sort" - "strconv" - "strings" - "sync" - "time" - - "github.com/cihub/seelog/archive" - "github.com/cihub/seelog/archive/gzip" - "github.com/cihub/seelog/archive/tar" - "github.com/cihub/seelog/archive/zip" -) - -// Common constants -const ( - rollingLogHistoryDelimiter = "." -) - -// Types of the rolling writer: roll by date, by time, etc. -type rollingType uint8 - -const ( - rollingTypeSize = iota - rollingTypeTime -) - -// Types of the rolled file naming mode: prefix, postfix, etc. -type rollingNameMode uint8 - -const ( - rollingNameModePostfix = iota - rollingNameModePrefix -) - -var rollingNameModesStringRepresentation = map[rollingNameMode]string{ - rollingNameModePostfix: "postfix", - rollingNameModePrefix: "prefix", -} - -func rollingNameModeFromString(rollingNameStr string) (rollingNameMode, bool) { - for tp, tpStr := range rollingNameModesStringRepresentation { - if tpStr == rollingNameStr { - return tp, true - } - } - - return 0, false -} - -var rollingTypesStringRepresentation = map[rollingType]string{ - rollingTypeSize: "size", - rollingTypeTime: "date", -} - -func rollingTypeFromString(rollingTypeStr string) (rollingType, bool) { - for tp, tpStr := range rollingTypesStringRepresentation { - if tpStr == rollingTypeStr { - return tp, true - } - } - - return 0, false -} - -// Old logs archivation type. -type rollingArchiveType uint8 - -const ( - rollingArchiveNone = iota - rollingArchiveZip - rollingArchiveGzip -) - -var rollingArchiveTypesStringRepresentation = map[rollingArchiveType]string{ - rollingArchiveNone: "none", - rollingArchiveZip: "zip", - rollingArchiveGzip: "gzip", -} - -type archiver func(f *os.File, exploded bool) archive.WriteCloser - -type unarchiver func(f *os.File) (archive.ReadCloser, error) - -type compressionType struct { - extension string - handleMultipleEntries bool - archiver archiver - unarchiver unarchiver -} - -var compressionTypes = map[rollingArchiveType]compressionType{ - rollingArchiveZip: { - extension: ".zip", - handleMultipleEntries: true, - archiver: func(f *os.File, _ bool) archive.WriteCloser { - return zip.NewWriter(f) - }, - unarchiver: func(f *os.File) (archive.ReadCloser, error) { - fi, err := f.Stat() - if err != nil { - return nil, err - } - r, err := zip.NewReader(f, fi.Size()) - if err != nil { - return nil, err - } - return archive.NopCloser(r), nil - }, - }, - rollingArchiveGzip: { - extension: ".gz", - handleMultipleEntries: false, - archiver: func(f *os.File, exploded bool) archive.WriteCloser { - gw := gzip.NewWriter(f) - if exploded { - return gw - } - return tar.NewWriteMultiCloser(gw, gw) - }, - unarchiver: func(f *os.File) (archive.ReadCloser, error) { - gr, err := gzip.NewReader(f, f.Name()) - if err != nil { - return nil, err - } - - // Determine if the gzip is a tar - tr := tar.NewReader(gr) - _, err = tr.Next() - isTar := err == nil - - // Reset to beginning of file - if _, err := f.Seek(0, os.SEEK_SET); err != nil { - return nil, err - } - gr.Reset(f) - - if isTar { - return archive.NopCloser(tar.NewReader(gr)), nil - } - return gr, nil - }, - }, -} - -func (compressionType *compressionType) rollingArchiveTypeName(name string, exploded bool) string { - if !compressionType.handleMultipleEntries && !exploded { - return name + ".tar" + compressionType.extension - } else { - return name + compressionType.extension - } - -} - -func rollingArchiveTypeFromString(rollingArchiveTypeStr string) (rollingArchiveType, bool) { - for tp, tpStr := range rollingArchiveTypesStringRepresentation { - if tpStr == rollingArchiveTypeStr { - return tp, true - } - } - - return 0, false -} - -// Default names for different archive types -var rollingArchiveDefaultExplodedName = "old" - -func rollingArchiveTypeDefaultName(archiveType rollingArchiveType, exploded bool) (string, error) { - compressionType, ok := compressionTypes[archiveType] - if !ok { - return "", fmt.Errorf("cannot get default filename for archive type = %v", archiveType) - } - return compressionType.rollingArchiveTypeName("log", exploded), nil -} - -// rollerVirtual is an interface that represents all virtual funcs that are -// called in different rolling writer subtypes. -type rollerVirtual interface { - needsToRoll() bool // Returns true if needs to switch to another file. - isFileRollNameValid(rname string) bool // Returns true if logger roll file name (postfix/prefix/etc.) is ok. - sortFileRollNamesAsc(fs []string) ([]string, error) // Sorts logger roll file names in ascending order of their creation by logger. - - // getNewHistoryRollFileName is called whenever we are about to roll the - // current log file. It returns the name the current log file should be - // rolled to. - getNewHistoryRollFileName(otherHistoryFiles []string) string - - getCurrentFileName() string -} - -// rollingFileWriter writes received messages to a file, until time interval passes -// or file exceeds a specified limit. After that the current log file is renamed -// and writer starts to log into a new file. You can set a limit for such renamed -// files count, if you want, and then the rolling writer would delete older ones when -// the files count exceed the specified limit. -type rollingFileWriter struct { - fileName string // log file name - currentDirPath string - currentFile *os.File - currentName string - currentFileSize int64 - rollingType rollingType // Rolling mode (Files roll by size/date/...) - archiveType rollingArchiveType - archivePath string - archiveExploded bool - fullName bool - maxRolls int - nameMode rollingNameMode - self rollerVirtual // Used for virtual calls - rollLock sync.Mutex -} - -func newRollingFileWriter(fpath string, rtype rollingType, atype rollingArchiveType, apath string, maxr int, namemode rollingNameMode, - archiveExploded bool, fullName bool) (*rollingFileWriter, error) { - rw := new(rollingFileWriter) - rw.currentDirPath, rw.fileName = filepath.Split(fpath) - if len(rw.currentDirPath) == 0 { - rw.currentDirPath = "." - } - - rw.rollingType = rtype - rw.archiveType = atype - rw.archivePath = apath - rw.nameMode = namemode - rw.maxRolls = maxr - rw.archiveExploded = archiveExploded - rw.fullName = fullName - return rw, nil -} - -func (rw *rollingFileWriter) hasRollName(file string) bool { - switch rw.nameMode { - case rollingNameModePostfix: - rname := rw.fileName + rollingLogHistoryDelimiter - return strings.HasPrefix(file, rname) - case rollingNameModePrefix: - rname := rollingLogHistoryDelimiter + rw.fileName - return strings.HasSuffix(file, rname) - } - return false -} - -func (rw *rollingFileWriter) createFullFileName(originalName, rollname string) string { - switch rw.nameMode { - case rollingNameModePostfix: - return originalName + rollingLogHistoryDelimiter + rollname - case rollingNameModePrefix: - return rollname + rollingLogHistoryDelimiter + originalName - } - return "" -} - -func (rw *rollingFileWriter) getSortedLogHistory() ([]string, error) { - files, err := getDirFilePaths(rw.currentDirPath, nil, true) - if err != nil { - return nil, err - } - var validRollNames []string - for _, file := range files { - if rw.hasRollName(file) { - rname := rw.getFileRollName(file) - if rw.self.isFileRollNameValid(rname) { - validRollNames = append(validRollNames, rname) - } - } - } - sortedTails, err := rw.self.sortFileRollNamesAsc(validRollNames) - if err != nil { - return nil, err - } - validSortedFiles := make([]string, len(sortedTails)) - for i, v := range sortedTails { - validSortedFiles[i] = rw.createFullFileName(rw.fileName, v) - } - return validSortedFiles, nil -} - -func (rw *rollingFileWriter) createFileAndFolderIfNeeded(first bool) error { - var err error - - if len(rw.currentDirPath) != 0 { - err = os.MkdirAll(rw.currentDirPath, defaultDirectoryPermissions) - - if err != nil { - return err - } - } - rw.currentName = rw.self.getCurrentFileName() - filePath := filepath.Join(rw.currentDirPath, rw.currentName) - - // This will either open the existing file (without truncating it) or - // create if necessary. Append mode avoids any race conditions. - rw.currentFile, err = os.OpenFile(filePath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, defaultFilePermissions) - if err != nil { - return err - } - - stat, err := rw.currentFile.Stat() - if err != nil { - rw.currentFile.Close() - rw.currentFile = nil - return err - } - - rw.currentFileSize = stat.Size() - return nil -} - -func (rw *rollingFileWriter) archiveExplodedLogs(logFilename string, compressionType compressionType) (err error) { - closeWithError := func(c io.Closer) { - if cerr := c.Close(); cerr != nil && err == nil { - err = cerr - } - } - - rollPath := filepath.Join(rw.currentDirPath, logFilename) - src, err := os.Open(rollPath) - if err != nil { - return err - } - defer src.Close() // Read-only - - // Buffer to a temporary file on the same partition - // Note: archivePath is a path to a directory when handling exploded logs - dst, err := rw.tempArchiveFile(rw.archivePath) - if err != nil { - return err - } - defer func() { - closeWithError(dst) - if err != nil { - os.Remove(dst.Name()) // Can't do anything when we fail to remove temp file - return - } - - // Finalize archive by swapping the buffered archive into place - err = os.Rename(dst.Name(), filepath.Join(rw.archivePath, - compressionType.rollingArchiveTypeName(logFilename, true))) - }() - - // archive entry - w := compressionType.archiver(dst, true) - defer closeWithError(w) - fi, err := src.Stat() - if err != nil { - return err - } - if err := w.NextFile(logFilename, fi); err != nil { - return err - } - _, err = io.Copy(w, src) - return err -} - -func (rw *rollingFileWriter) archiveUnexplodedLogs(compressionType compressionType, rollsToDelete int, history []string) (err error) { - closeWithError := func(c io.Closer) { - if cerr := c.Close(); cerr != nil && err == nil { - err = cerr - } - } - - // Buffer to a temporary file on the same partition - // Note: archivePath is a path to a file when handling unexploded logs - dst, err := rw.tempArchiveFile(filepath.Dir(rw.archivePath)) - if err != nil { - return err - } - defer func() { - closeWithError(dst) - if err != nil { - os.Remove(dst.Name()) // Can't do anything when we fail to remove temp file - return - } - - // Finalize archive by moving the buffered archive into place - err = os.Rename(dst.Name(), rw.archivePath) - }() - - w := compressionType.archiver(dst, false) - defer closeWithError(w) - - src, err := os.Open(rw.archivePath) - switch { - // Archive exists - case err == nil: - defer src.Close() // Read-only - - r, err := compressionType.unarchiver(src) - if err != nil { - return err - } - defer r.Close() // Read-only - - if err := archive.Copy(w, r); err != nil { - return err - } - - // Failed to stat - case !os.IsNotExist(err): - return err - } - - // Add new files to the archive - for i := 0; i < rollsToDelete; i++ { - rollPath := filepath.Join(rw.currentDirPath, history[i]) - src, err := os.Open(rollPath) - if err != nil { - return err - } - defer src.Close() // Read-only - fi, err := src.Stat() - if err != nil { - return err - } - if err := w.NextFile(src.Name(), fi); err != nil { - return err - } - if _, err := io.Copy(w, src); err != nil { - return err - } - } - return nil -} - -func (rw *rollingFileWriter) deleteOldRolls(history []string) error { - if rw.maxRolls <= 0 { - return nil - } - - rollsToDelete := len(history) - rw.maxRolls - if rollsToDelete <= 0 { - return nil - } - - if rw.archiveType != rollingArchiveNone { - if rw.archiveExploded { - os.MkdirAll(rw.archivePath, defaultDirectoryPermissions) - - // Archive logs - for i := 0; i < rollsToDelete; i++ { - rw.archiveExplodedLogs(history[i], compressionTypes[rw.archiveType]) - } - } else { - os.MkdirAll(filepath.Dir(rw.archivePath), defaultDirectoryPermissions) - - rw.archiveUnexplodedLogs(compressionTypes[rw.archiveType], rollsToDelete, history) - } - } - - var err error - // In all cases (archive files or not) the files should be deleted. - for i := 0; i < rollsToDelete; i++ { - // Try best to delete files without breaking the loop. - if err = tryRemoveFile(filepath.Join(rw.currentDirPath, history[i])); err != nil { - reportInternalError(err) - } - } - - return nil -} - -func (rw *rollingFileWriter) getFileRollName(fileName string) string { - switch rw.nameMode { - case rollingNameModePostfix: - return fileName[len(rw.fileName+rollingLogHistoryDelimiter):] - case rollingNameModePrefix: - return fileName[:len(fileName)-len(rw.fileName+rollingLogHistoryDelimiter)] - } - return "" -} - -func (rw *rollingFileWriter) roll() error { - // First, close current file. - err := rw.currentFile.Close() - if err != nil { - return err - } - rw.currentFile = nil - - // Current history of all previous log files. - // For file roller it may be like this: - // * ... - // * file.log.4 - // * file.log.5 - // * file.log.6 - // - // For date roller it may look like this: - // * ... - // * file.log.11.Aug.13 - // * file.log.15.Aug.13 - // * file.log.16.Aug.13 - // Sorted log history does NOT include current file. - history, err := rw.getSortedLogHistory() - if err != nil { - return err - } - // Renames current file to create a new roll history entry - // For file roller it may be like this: - // * ... - // * file.log.4 - // * file.log.5 - // * file.log.6 - // n file.log.7 <---- RENAMED (from file.log) - newHistoryName := rw.createFullFileName(rw.fileName, - rw.self.getNewHistoryRollFileName(history)) - - err = os.Rename(filepath.Join(rw.currentDirPath, rw.currentName), filepath.Join(rw.currentDirPath, newHistoryName)) - if err != nil { - return err - } - - // Finally, add the newly added history file to the history archive - // and, if after that the archive exceeds the allowed max limit, older rolls - // must the removed/archived. - history = append(history, newHistoryName) - if len(history) > rw.maxRolls { - err = rw.deleteOldRolls(history) - if err != nil { - return err - } - } - - return nil -} - -func (rw *rollingFileWriter) Write(bytes []byte) (n int, err error) { - rw.rollLock.Lock() - defer rw.rollLock.Unlock() - - if rw.self.needsToRoll() { - if err := rw.roll(); err != nil { - return 0, err - } - } - - if rw.currentFile == nil { - err := rw.createFileAndFolderIfNeeded(true) - if err != nil { - return 0, err - } - } - - n, err = rw.currentFile.Write(bytes) - rw.currentFileSize += int64(n) - return n, err -} - -func (rw *rollingFileWriter) Close() error { - if rw.currentFile != nil { - e := rw.currentFile.Close() - if e != nil { - return e - } - rw.currentFile = nil - } - return nil -} - -func (rw *rollingFileWriter) tempArchiveFile(archiveDir string) (*os.File, error) { - tmp := filepath.Join(archiveDir, ".seelog_tmp") - if err := os.MkdirAll(tmp, defaultDirectoryPermissions); err != nil { - return nil, err - } - return ioutil.TempFile(tmp, "archived_logs") -} - -// ============================================================================================= -// Different types of rolling writers -// ============================================================================================= - -// -------------------------------------------------- -// Rolling writer by SIZE -// -------------------------------------------------- - -// rollingFileWriterSize performs roll when file exceeds a specified limit. -type rollingFileWriterSize struct { - *rollingFileWriter - maxFileSize int64 -} - -func NewRollingFileWriterSize(fpath string, atype rollingArchiveType, apath string, maxSize int64, maxRolls int, namemode rollingNameMode, archiveExploded bool) (*rollingFileWriterSize, error) { - rw, err := newRollingFileWriter(fpath, rollingTypeSize, atype, apath, maxRolls, namemode, archiveExploded, false) - if err != nil { - return nil, err - } - rws := &rollingFileWriterSize{rw, maxSize} - rws.self = rws - return rws, nil -} - -func (rws *rollingFileWriterSize) needsToRoll() bool { - return rws.currentFileSize >= rws.maxFileSize -} - -func (rws *rollingFileWriterSize) isFileRollNameValid(rname string) bool { - if len(rname) == 0 { - return false - } - _, err := strconv.Atoi(rname) - return err == nil -} - -type rollSizeFileTailsSlice []string - -func (p rollSizeFileTailsSlice) Len() int { - return len(p) -} -func (p rollSizeFileTailsSlice) Less(i, j int) bool { - v1, _ := strconv.Atoi(p[i]) - v2, _ := strconv.Atoi(p[j]) - return v1 < v2 -} -func (p rollSizeFileTailsSlice) Swap(i, j int) { - p[i], p[j] = p[j], p[i] -} - -func (rws *rollingFileWriterSize) sortFileRollNamesAsc(fs []string) ([]string, error) { - ss := rollSizeFileTailsSlice(fs) - sort.Sort(ss) - return ss, nil -} - -func (rws *rollingFileWriterSize) getNewHistoryRollFileName(otherLogFiles []string) string { - v := 0 - if len(otherLogFiles) != 0 { - latest := otherLogFiles[len(otherLogFiles)-1] - v, _ = strconv.Atoi(rws.getFileRollName(latest)) - } - return fmt.Sprintf("%d", v+1) -} - -func (rws *rollingFileWriterSize) getCurrentFileName() string { - return rws.fileName -} - -func (rws *rollingFileWriterSize) String() string { - return fmt.Sprintf("Rolling file writer (By SIZE): filename: %s, archive: %s, archivefile: %s, maxFileSize: %v, maxRolls: %v", - rws.fileName, - rollingArchiveTypesStringRepresentation[rws.archiveType], - rws.archivePath, - rws.maxFileSize, - rws.maxRolls) -} - -// -------------------------------------------------- -// Rolling writer by TIME -// -------------------------------------------------- - -// rollingFileWriterTime performs roll when a specified time interval has passed. -type rollingFileWriterTime struct { - *rollingFileWriter - timePattern string - currentTimeFileName string -} - -func NewRollingFileWriterTime(fpath string, atype rollingArchiveType, apath string, maxr int, - timePattern string, namemode rollingNameMode, archiveExploded bool, fullName bool) (*rollingFileWriterTime, error) { - - rw, err := newRollingFileWriter(fpath, rollingTypeTime, atype, apath, maxr, namemode, archiveExploded, fullName) - if err != nil { - return nil, err - } - rws := &rollingFileWriterTime{rw, timePattern, ""} - rws.self = rws - return rws, nil -} - -func (rwt *rollingFileWriterTime) needsToRoll() bool { - newName := time.Now().Format(rwt.timePattern) - - if rwt.currentTimeFileName == "" { - // first run; capture the current name - rwt.currentTimeFileName = newName - return false - } - - return newName != rwt.currentTimeFileName -} - -func (rwt *rollingFileWriterTime) isFileRollNameValid(rname string) bool { - if len(rname) == 0 { - return false - } - _, err := time.ParseInLocation(rwt.timePattern, rname, time.Local) - return err == nil -} - -type rollTimeFileTailsSlice struct { - data []string - pattern string -} - -func (p rollTimeFileTailsSlice) Len() int { - return len(p.data) -} - -func (p rollTimeFileTailsSlice) Less(i, j int) bool { - t1, _ := time.ParseInLocation(p.pattern, p.data[i], time.Local) - t2, _ := time.ParseInLocation(p.pattern, p.data[j], time.Local) - return t1.Before(t2) -} - -func (p rollTimeFileTailsSlice) Swap(i, j int) { - p.data[i], p.data[j] = p.data[j], p.data[i] -} - -func (rwt *rollingFileWriterTime) sortFileRollNamesAsc(fs []string) ([]string, error) { - ss := rollTimeFileTailsSlice{data: fs, pattern: rwt.timePattern} - sort.Sort(ss) - return ss.data, nil -} - -func (rwt *rollingFileWriterTime) getNewHistoryRollFileName(_ []string) string { - newFileName := rwt.currentTimeFileName - rwt.currentTimeFileName = time.Now().Format(rwt.timePattern) - return newFileName -} - -func (rwt *rollingFileWriterTime) getCurrentFileName() string { - if rwt.fullName { - return rwt.createFullFileName(rwt.fileName, time.Now().Format(rwt.timePattern)) - } - return rwt.fileName -} - -func (rwt *rollingFileWriterTime) String() string { - return fmt.Sprintf("Rolling file writer (By TIME): filename: %s, archive: %s, archivefile: %s, pattern: %s, maxRolls: %v", - rwt.fileName, - rollingArchiveTypesStringRepresentation[rwt.archiveType], - rwt.archivePath, - rwt.timePattern, - rwt.maxRolls) -} diff --git a/vendor/github.com/cihub/seelog/writers_smtpwriter.go b/vendor/github.com/cihub/seelog/writers_smtpwriter.go deleted file mode 100644 index 31b79438..00000000 --- a/vendor/github.com/cihub/seelog/writers_smtpwriter.go +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) 2012 - Cloud Instruments Co., Ltd. -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package seelog - -import ( - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "io/ioutil" - "net/smtp" - "path/filepath" - "strings" -) - -const ( - // Default subject phrase for sending emails. - DefaultSubjectPhrase = "Diagnostic message from server: " - - // Message subject pattern composed according to RFC 5321. - rfc5321SubjectPattern = "From: %s <%s>\nSubject: %s\n\n" -) - -// smtpWriter is used to send emails via given SMTP-server. -type smtpWriter struct { - auth smtp.Auth - hostName string - hostPort string - hostNameWithPort string - senderAddress string - senderName string - recipientAddresses []string - caCertDirPaths []string - mailHeaders []string - subject string -} - -// NewSMTPWriter returns a new SMTP-writer. -func NewSMTPWriter(sa, sn string, ras []string, hn, hp, un, pwd string, cacdps []string, subj string, headers []string) *smtpWriter { - return &smtpWriter{ - auth: smtp.PlainAuth("", un, pwd, hn), - hostName: hn, - hostPort: hp, - hostNameWithPort: fmt.Sprintf("%s:%s", hn, hp), - senderAddress: sa, - senderName: sn, - recipientAddresses: ras, - caCertDirPaths: cacdps, - subject: subj, - mailHeaders: headers, - } -} - -func prepareMessage(senderAddr, senderName, subject string, body []byte, headers []string) []byte { - headerLines := fmt.Sprintf(rfc5321SubjectPattern, senderName, senderAddr, subject) - // Build header lines if configured. - if headers != nil && len(headers) > 0 { - headerLines += strings.Join(headers, "\n") - headerLines += "\n" - } - return append([]byte(headerLines), body...) -} - -// getTLSConfig gets paths of PEM files with certificates, -// host server name and tries to create an appropriate TLS.Config. -func getTLSConfig(pemFileDirPaths []string, hostName string) (config *tls.Config, err error) { - if pemFileDirPaths == nil || len(pemFileDirPaths) == 0 { - err = errors.New("invalid PEM file paths") - return - } - pemEncodedContent := []byte{} - var ( - e error - bytes []byte - ) - // Create a file-filter-by-extension, set aside non-pem files. - pemFilePathFilter := func(fp string) bool { - if filepath.Ext(fp) == ".pem" { - return true - } - return false - } - for _, pemFileDirPath := range pemFileDirPaths { - pemFilePaths, err := getDirFilePaths(pemFileDirPath, pemFilePathFilter, false) - if err != nil { - return nil, err - } - - // Put together all the PEM files to decode them as a whole byte slice. - for _, pfp := range pemFilePaths { - if bytes, e = ioutil.ReadFile(pfp); e == nil { - pemEncodedContent = append(pemEncodedContent, bytes...) - } else { - return nil, fmt.Errorf("cannot read file: %s: %s", pfp, e.Error()) - } - } - } - config = &tls.Config{RootCAs: x509.NewCertPool(), ServerName: hostName} - isAppended := config.RootCAs.AppendCertsFromPEM(pemEncodedContent) - if !isAppended { - // Extract this into a separate error. - err = errors.New("invalid PEM content") - return - } - return -} - -// SendMail accepts TLS configuration, connects to the server at addr, -// switches to TLS if possible, authenticates with mechanism a if possible, -// and then sends an email from address from, to addresses to, with message msg. -func sendMailWithTLSConfig(config *tls.Config, addr string, a smtp.Auth, from string, to []string, msg []byte) error { - c, err := smtp.Dial(addr) - if err != nil { - return err - } - // Check if the server supports STARTTLS extension. - if ok, _ := c.Extension("STARTTLS"); ok { - if err = c.StartTLS(config); err != nil { - return err - } - } - // Check if the server supports AUTH extension and use given smtp.Auth. - if a != nil { - if isSupported, _ := c.Extension("AUTH"); isSupported { - if err = c.Auth(a); err != nil { - return err - } - } - } - // Portion of code from the official smtp.SendMail function, - // see http://golang.org/src/pkg/net/smtp/smtp.go. - if err = c.Mail(from); err != nil { - return err - } - for _, addr := range to { - if err = c.Rcpt(addr); err != nil { - return err - } - } - w, err := c.Data() - if err != nil { - return err - } - _, err = w.Write(msg) - if err != nil { - return err - } - err = w.Close() - if err != nil { - return err - } - return c.Quit() -} - -// Write pushes a text message properly composed according to RFC 5321 -// to a post server, which sends it to the recipients. -func (smtpw *smtpWriter) Write(data []byte) (int, error) { - var err error - - if smtpw.caCertDirPaths == nil { - err = smtp.SendMail( - smtpw.hostNameWithPort, - smtpw.auth, - smtpw.senderAddress, - smtpw.recipientAddresses, - prepareMessage(smtpw.senderAddress, smtpw.senderName, smtpw.subject, data, smtpw.mailHeaders), - ) - } else { - config, e := getTLSConfig(smtpw.caCertDirPaths, smtpw.hostName) - if e != nil { - return 0, e - } - err = sendMailWithTLSConfig( - config, - smtpw.hostNameWithPort, - smtpw.auth, - smtpw.senderAddress, - smtpw.recipientAddresses, - prepareMessage(smtpw.senderAddress, smtpw.senderName, smtpw.subject, data, smtpw.mailHeaders), - ) - } - if err != nil { - return 0, err - } - return len(data), nil -} - -// Close closes down SMTP-connection. -func (smtpw *smtpWriter) Close() error { - // Do nothing as Write method opens and closes connection automatically. - return nil -} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/lakeFormation_client.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/lakeFormation_client.go new file mode 100644 index 00000000..c6d0669c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/lakeFormation_client.go @@ -0,0 +1,1503 @@ +package v1 + +import ( + http_client "github.com/huaweicloud/huaweicloud-sdk-go-v3/core" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/invoker" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model" +) + +type LakeFormationClient struct { + HcClient *http_client.HcHttpClient +} + +func NewLakeFormationClient(hcClient *http_client.HcHttpClient) *LakeFormationClient { + return &LakeFormationClient{HcClient: hcClient} +} + +func LakeFormationClientBuilder() *http_client.HcHttpClientBuilder { + builder := http_client.NewHcHttpClientBuilder() + return builder +} + +// ApplyForAccess 申请接入服务 +// +// 申请接入服务 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ApplyForAccess(request *model.ApplyForAccessRequest) (*model.ApplyForAccessResponse, error) { + requestDef := GenReqDefForApplyForAccess() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ApplyForAccessResponse), nil + } +} + +// ApplyForAccessInvoker 申请接入服务 +func (c *LakeFormationClient) ApplyForAccessInvoker(request *model.ApplyForAccessRequest) *ApplyForAccessInvoker { + requestDef := GenReqDefForApplyForAccess() + return &ApplyForAccessInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// BatchAuthorizeInterface 批量授权 +// +// 批量授权接口 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) BatchAuthorizeInterface(request *model.BatchAuthorizeInterfaceRequest) (*model.BatchAuthorizeInterfaceResponse, error) { + requestDef := GenReqDefForBatchAuthorizeInterface() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.BatchAuthorizeInterfaceResponse), nil + } +} + +// BatchAuthorizeInterfaceInvoker 批量授权 +func (c *LakeFormationClient) BatchAuthorizeInterfaceInvoker(request *model.BatchAuthorizeInterfaceRequest) *BatchAuthorizeInterfaceInvoker { + requestDef := GenReqDefForBatchAuthorizeInterface() + return &BatchAuthorizeInterfaceInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// BatchCancelAuthorizationInterface 取消批量授权 +// +// 批量取消授权接口 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) BatchCancelAuthorizationInterface(request *model.BatchCancelAuthorizationInterfaceRequest) (*model.BatchCancelAuthorizationInterfaceResponse, error) { + requestDef := GenReqDefForBatchCancelAuthorizationInterface() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.BatchCancelAuthorizationInterfaceResponse), nil + } +} + +// BatchCancelAuthorizationInterfaceInvoker 取消批量授权 +func (c *LakeFormationClient) BatchCancelAuthorizationInterfaceInvoker(request *model.BatchCancelAuthorizationInterfaceRequest) *BatchCancelAuthorizationInterfaceInvoker { + requestDef := GenReqDefForBatchCancelAuthorizationInterface() + return &BatchCancelAuthorizationInterfaceInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListAccessInfos 获取服务接入信息 +// +// 根据LakeFormation实例获取服务实例相关的接入信息。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListAccessInfos(request *model.ListAccessInfosRequest) (*model.ListAccessInfosResponse, error) { + requestDef := GenReqDefForListAccessInfos() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListAccessInfosResponse), nil + } +} + +// ListAccessInfosInvoker 获取服务接入信息 +func (c *LakeFormationClient) ListAccessInfosInvoker(request *model.ListAccessInfosRequest) *ListAccessInfosInvoker { + requestDef := GenReqDefForListAccessInfos() + return &ListAccessInfosInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListInterfaces 查询策略 +// +// 通过过滤条件查询接口 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListInterfaces(request *model.ListInterfacesRequest) (*model.ListInterfacesResponse, error) { + requestDef := GenReqDefForListInterfaces() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListInterfacesResponse), nil + } +} + +// ListInterfacesInvoker 查询策略 +func (c *LakeFormationClient) ListInterfacesInvoker(request *model.ListInterfacesRequest) *ListInterfacesInvoker { + requestDef := GenReqDefForListInterfaces() + return &ListInterfacesInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListPolicy 获取同步权限策略 +// +// 分页获取同步权限策略 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListPolicy(request *model.ListPolicyRequest) (*model.ListPolicyResponse, error) { + requestDef := GenReqDefForListPolicy() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListPolicyResponse), nil + } +} + +// ListPolicyInvoker 获取同步权限策略 +func (c *LakeFormationClient) ListPolicyInvoker(request *model.ListPolicyRequest) *ListPolicyInvoker { + requestDef := GenReqDefForListPolicy() + return &ListPolicyInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ShowSyncPolicy 获取同步权限策略 +// +// 获取同步权限策略 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ShowSyncPolicy(request *model.ShowSyncPolicyRequest) (*model.ShowSyncPolicyResponse, error) { + requestDef := GenReqDefForShowSyncPolicy() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ShowSyncPolicyResponse), nil + } +} + +// ShowSyncPolicyInvoker 获取同步权限策略 +func (c *LakeFormationClient) ShowSyncPolicyInvoker(request *model.ShowSyncPolicyRequest) *ShowSyncPolicyInvoker { + requestDef := GenReqDefForShowSyncPolicy() + return &ShowSyncPolicyInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// CreateCatalog 创建catalog +// +// 创建catalog,会在catalog下创建默认数据库,默认数据库名字为:default +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) CreateCatalog(request *model.CreateCatalogRequest) (*model.CreateCatalogResponse, error) { + requestDef := GenReqDefForCreateCatalog() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.CreateCatalogResponse), nil + } +} + +// CreateCatalogInvoker 创建catalog +func (c *LakeFormationClient) CreateCatalogInvoker(request *model.CreateCatalogRequest) *CreateCatalogInvoker { + requestDef := GenReqDefForCreateCatalog() + return &CreateCatalogInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeleteCatalog 删除catalog对象 +// +// 删除空的catalog对象。 +// 删除前需要保证catalog下只有默认的数据库,且默认数据库下没有表对象,否则删除失败。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) DeleteCatalog(request *model.DeleteCatalogRequest) (*model.DeleteCatalogResponse, error) { + requestDef := GenReqDefForDeleteCatalog() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeleteCatalogResponse), nil + } +} + +// DeleteCatalogInvoker 删除catalog对象 +func (c *LakeFormationClient) DeleteCatalogInvoker(request *model.DeleteCatalogRequest) *DeleteCatalogInvoker { + requestDef := GenReqDefForDeleteCatalog() + return &DeleteCatalogInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListCatalogs 列举catalog信息 +// +// 根据catalog名字的通配符列举catalog的详细信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListCatalogs(request *model.ListCatalogsRequest) (*model.ListCatalogsResponse, error) { + requestDef := GenReqDefForListCatalogs() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListCatalogsResponse), nil + } +} + +// ListCatalogsInvoker 列举catalog信息 +func (c *LakeFormationClient) ListCatalogsInvoker(request *model.ListCatalogsRequest) *ListCatalogsInvoker { + requestDef := GenReqDefForListCatalogs() + return &ListCatalogsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ShowCatalog 获取catalog信息 +// +// 获取catalog信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ShowCatalog(request *model.ShowCatalogRequest) (*model.ShowCatalogResponse, error) { + requestDef := GenReqDefForShowCatalog() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ShowCatalogResponse), nil + } +} + +// ShowCatalogInvoker 获取catalog信息 +func (c *LakeFormationClient) ShowCatalogInvoker(request *model.ShowCatalogRequest) *ShowCatalogInvoker { + requestDef := GenReqDefForShowCatalog() + return &ShowCatalogInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// UpdateCatalog 修改catalog信息 +// +// 修改catalog信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) UpdateCatalog(request *model.UpdateCatalogRequest) (*model.UpdateCatalogResponse, error) { + requestDef := GenReqDefForUpdateCatalog() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.UpdateCatalogResponse), nil + } +} + +// UpdateCatalogInvoker 修改catalog信息 +func (c *LakeFormationClient) UpdateCatalogInvoker(request *model.UpdateCatalogRequest) *UpdateCatalogInvoker { + requestDef := GenReqDefForUpdateCatalog() + return &UpdateCatalogInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// CreateDatabase 创建数据库 +// +// 创建数据库 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) CreateDatabase(request *model.CreateDatabaseRequest) (*model.CreateDatabaseResponse, error) { + requestDef := GenReqDefForCreateDatabase() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.CreateDatabaseResponse), nil + } +} + +// CreateDatabaseInvoker 创建数据库 +func (c *LakeFormationClient) CreateDatabaseInvoker(request *model.CreateDatabaseRequest) *CreateDatabaseInvoker { + requestDef := GenReqDefForCreateDatabase() + return &CreateDatabaseInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeleteDatabase 删除数据库 +// +// 删除指定数据库,catalog的默认数据库不允许删除。 +// cascade: 指定为true时,删除数据库下的表;指定为false时,只能删除空的数据库 +// delete_data: 指定为true时,级联删除会将表的数据放入回收站;指定为false时,不删除表数据 +// 删除数据库后不支持恢复数据库下的事务表。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) DeleteDatabase(request *model.DeleteDatabaseRequest) (*model.DeleteDatabaseResponse, error) { + requestDef := GenReqDefForDeleteDatabase() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeleteDatabaseResponse), nil + } +} + +// DeleteDatabaseInvoker 删除数据库 +func (c *LakeFormationClient) DeleteDatabaseInvoker(request *model.DeleteDatabaseRequest) *DeleteDatabaseInvoker { + requestDef := GenReqDefForDeleteDatabase() + return &DeleteDatabaseInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListDatabaseNames 列举数据库名称信息 +// +// 列举数据库名称信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListDatabaseNames(request *model.ListDatabaseNamesRequest) (*model.ListDatabaseNamesResponse, error) { + requestDef := GenReqDefForListDatabaseNames() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListDatabaseNamesResponse), nil + } +} + +// ListDatabaseNamesInvoker 列举数据库名称信息 +func (c *LakeFormationClient) ListDatabaseNamesInvoker(request *model.ListDatabaseNamesRequest) *ListDatabaseNamesInvoker { + requestDef := GenReqDefForListDatabaseNames() + return &ListDatabaseNamesInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListDatabases 列举数据库信息 +// +// 列举数据库信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListDatabases(request *model.ListDatabasesRequest) (*model.ListDatabasesResponse, error) { + requestDef := GenReqDefForListDatabases() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListDatabasesResponse), nil + } +} + +// ListDatabasesInvoker 列举数据库信息 +func (c *LakeFormationClient) ListDatabasesInvoker(request *model.ListDatabasesRequest) *ListDatabasesInvoker { + requestDef := GenReqDefForListDatabases() + return &ListDatabasesInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ShowDatabase 获取数据库 +// +// 获取数据库 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ShowDatabase(request *model.ShowDatabaseRequest) (*model.ShowDatabaseResponse, error) { + requestDef := GenReqDefForShowDatabase() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ShowDatabaseResponse), nil + } +} + +// ShowDatabaseInvoker 获取数据库 +func (c *LakeFormationClient) ShowDatabaseInvoker(request *model.ShowDatabaseRequest) *ShowDatabaseInvoker { + requestDef := GenReqDefForShowDatabase() + return &ShowDatabaseInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// UpdateDatabase 修改数据库属性 +// +// 修改数据库属性 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) UpdateDatabase(request *model.UpdateDatabaseRequest) (*model.UpdateDatabaseResponse, error) { + requestDef := GenReqDefForUpdateDatabase() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.UpdateDatabaseResponse), nil + } +} + +// UpdateDatabaseInvoker 修改数据库属性 +func (c *LakeFormationClient) UpdateDatabaseInvoker(request *model.UpdateDatabaseRequest) *UpdateDatabaseInvoker { + requestDef := GenReqDefForUpdateDatabase() + return &UpdateDatabaseInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// CreateFunction 创建函数 +// +// 创建函数 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) CreateFunction(request *model.CreateFunctionRequest) (*model.CreateFunctionResponse, error) { + requestDef := GenReqDefForCreateFunction() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.CreateFunctionResponse), nil + } +} + +// CreateFunctionInvoker 创建函数 +func (c *LakeFormationClient) CreateFunctionInvoker(request *model.CreateFunctionRequest) *CreateFunctionInvoker { + requestDef := GenReqDefForCreateFunction() + return &CreateFunctionInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeleteFunction 删除函数 +// +// 删除函数 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) DeleteFunction(request *model.DeleteFunctionRequest) (*model.DeleteFunctionResponse, error) { + requestDef := GenReqDefForDeleteFunction() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeleteFunctionResponse), nil + } +} + +// DeleteFunctionInvoker 删除函数 +func (c *LakeFormationClient) DeleteFunctionInvoker(request *model.DeleteFunctionRequest) *DeleteFunctionInvoker { + requestDef := GenReqDefForDeleteFunction() + return &DeleteFunctionInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListAllFunctions 列举catalog下所有的函数 +// +// 获取catalog下所有的函数 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListAllFunctions(request *model.ListAllFunctionsRequest) (*model.ListAllFunctionsResponse, error) { + requestDef := GenReqDefForListAllFunctions() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListAllFunctionsResponse), nil + } +} + +// ListAllFunctionsInvoker 列举catalog下所有的函数 +func (c *LakeFormationClient) ListAllFunctionsInvoker(request *model.ListAllFunctionsRequest) *ListAllFunctionsInvoker { + requestDef := GenReqDefForListAllFunctions() + return &ListAllFunctionsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListFunctions 列举函数 +// +// 列举函数 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListFunctions(request *model.ListFunctionsRequest) (*model.ListFunctionsResponse, error) { + requestDef := GenReqDefForListFunctions() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListFunctionsResponse), nil + } +} + +// ListFunctionsInvoker 列举函数 +func (c *LakeFormationClient) ListFunctionsInvoker(request *model.ListFunctionsRequest) *ListFunctionsInvoker { + requestDef := GenReqDefForListFunctions() + return &ListFunctionsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ShowFunction 查询函数 +// +// 根据函数名称查询函数信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ShowFunction(request *model.ShowFunctionRequest) (*model.ShowFunctionResponse, error) { + requestDef := GenReqDefForShowFunction() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ShowFunctionResponse), nil + } +} + +// ShowFunctionInvoker 查询函数 +func (c *LakeFormationClient) ShowFunctionInvoker(request *model.ShowFunctionRequest) *ShowFunctionInvoker { + requestDef := GenReqDefForShowFunction() + return &ShowFunctionInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// UpdateFunction 修改函数属性 +// +// 修改函数属性 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) UpdateFunction(request *model.UpdateFunctionRequest) (*model.UpdateFunctionResponse, error) { + requestDef := GenReqDefForUpdateFunction() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.UpdateFunctionResponse), nil + } +} + +// UpdateFunctionInvoker 修改函数属性 +func (c *LakeFormationClient) UpdateFunctionInvoker(request *model.UpdateFunctionRequest) *UpdateFunctionInvoker { + requestDef := GenReqDefForUpdateFunction() + return &UpdateFunctionInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// CreateAgreement 注册租户协议 +// +// 用户授权并委托 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) CreateAgreement(request *model.CreateAgreementRequest) (*model.CreateAgreementResponse, error) { + requestDef := GenReqDefForCreateAgreement() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.CreateAgreementResponse), nil + } +} + +// CreateAgreementInvoker 注册租户协议 +func (c *LakeFormationClient) CreateAgreementInvoker(request *model.CreateAgreementRequest) *CreateAgreementInvoker { + requestDef := GenReqDefForCreateAgreement() + return &CreateAgreementInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ShowAgreement 查询租户是否注册协议 +// +// 查询租户当前协议和委托信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ShowAgreement(request *model.ShowAgreementRequest) (*model.ShowAgreementResponse, error) { + requestDef := GenReqDefForShowAgreement() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ShowAgreementResponse), nil + } +} + +// ShowAgreementInvoker 查询租户是否注册协议 +func (c *LakeFormationClient) ShowAgreementInvoker(request *model.ShowAgreementRequest) *ShowAgreementInvoker { + requestDef := GenReqDefForShowAgreement() + return &ShowAgreementInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ShowAgreementRule 查询当前系统协议 +// +// 查询当前系统协议 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ShowAgreementRule(request *model.ShowAgreementRuleRequest) (*model.ShowAgreementRuleResponse, error) { + requestDef := GenReqDefForShowAgreementRule() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ShowAgreementRuleResponse), nil + } +} + +// ShowAgreementRuleInvoker 查询当前系统协议 +func (c *LakeFormationClient) ShowAgreementRuleInvoker(request *model.ShowAgreementRuleRequest) *ShowAgreementRuleInvoker { + requestDef := GenReqDefForShowAgreementRule() + return &ShowAgreementRuleInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// CountMetaObj 元数据数量统计 +// +// 元数据数量统计接口 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) CountMetaObj(request *model.CountMetaObjRequest) (*model.CountMetaObjResponse, error) { + requestDef := GenReqDefForCountMetaObj() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.CountMetaObjResponse), nil + } +} + +// CountMetaObjInvoker 元数据数量统计 +func (c *LakeFormationClient) CountMetaObjInvoker(request *model.CountMetaObjRequest) *CountMetaObjInvoker { + requestDef := GenReqDefForCountMetaObj() + return &CountMetaObjInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// CreateLakeFormationInstance 创建实例 +// +// 创建一个LakeFormation实例。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) CreateLakeFormationInstance(request *model.CreateLakeFormationInstanceRequest) (*model.CreateLakeFormationInstanceResponse, error) { + requestDef := GenReqDefForCreateLakeFormationInstance() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.CreateLakeFormationInstanceResponse), nil + } +} + +// CreateLakeFormationInstanceInvoker 创建实例 +func (c *LakeFormationClient) CreateLakeFormationInstanceInvoker(request *model.CreateLakeFormationInstanceRequest) *CreateLakeFormationInstanceInvoker { + requestDef := GenReqDefForCreateLakeFormationInstance() + return &CreateLakeFormationInstanceInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeleteLakeFormationInstance 删除实例 +// +// 根据实例Id删除LakeFormation实例。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) DeleteLakeFormationInstance(request *model.DeleteLakeFormationInstanceRequest) (*model.DeleteLakeFormationInstanceResponse, error) { + requestDef := GenReqDefForDeleteLakeFormationInstance() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeleteLakeFormationInstanceResponse), nil + } +} + +// DeleteLakeFormationInstanceInvoker 删除实例 +func (c *LakeFormationClient) DeleteLakeFormationInstanceInvoker(request *model.DeleteLakeFormationInstanceRequest) *DeleteLakeFormationInstanceInvoker { + requestDef := GenReqDefForDeleteLakeFormationInstance() + return &DeleteLakeFormationInstanceInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListLakeFormationInstances 查询实例列表 +// +// 查询用户创建的实例列表信息。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListLakeFormationInstances(request *model.ListLakeFormationInstancesRequest) (*model.ListLakeFormationInstancesResponse, error) { + requestDef := GenReqDefForListLakeFormationInstances() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListLakeFormationInstancesResponse), nil + } +} + +// ListLakeFormationInstancesInvoker 查询实例列表 +func (c *LakeFormationClient) ListLakeFormationInstancesInvoker(request *model.ListLakeFormationInstancesRequest) *ListLakeFormationInstancesInvoker { + requestDef := GenReqDefForListLakeFormationInstances() + return &ListLakeFormationInstancesInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// MoveLakeFormationInstanceOutRecycleBin 恢复实例 +// +// 从回收站恢复LakeFormation实例 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) MoveLakeFormationInstanceOutRecycleBin(request *model.MoveLakeFormationInstanceOutRecycleBinRequest) (*model.MoveLakeFormationInstanceOutRecycleBinResponse, error) { + requestDef := GenReqDefForMoveLakeFormationInstanceOutRecycleBin() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.MoveLakeFormationInstanceOutRecycleBinResponse), nil + } +} + +// MoveLakeFormationInstanceOutRecycleBinInvoker 恢复实例 +func (c *LakeFormationClient) MoveLakeFormationInstanceOutRecycleBinInvoker(request *model.MoveLakeFormationInstanceOutRecycleBinRequest) *MoveLakeFormationInstanceOutRecycleBinInvoker { + requestDef := GenReqDefForMoveLakeFormationInstanceOutRecycleBin() + return &MoveLakeFormationInstanceOutRecycleBinInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ShowLakeFormationInstance 查询实例详情 +// +// 使用实例Id查询LakeFormation实例详情 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ShowLakeFormationInstance(request *model.ShowLakeFormationInstanceRequest) (*model.ShowLakeFormationInstanceResponse, error) { + requestDef := GenReqDefForShowLakeFormationInstance() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ShowLakeFormationInstanceResponse), nil + } +} + +// ShowLakeFormationInstanceInvoker 查询实例详情 +func (c *LakeFormationClient) ShowLakeFormationInstanceInvoker(request *model.ShowLakeFormationInstanceRequest) *ShowLakeFormationInstanceInvoker { + requestDef := GenReqDefForShowLakeFormationInstance() + return &ShowLakeFormationInstanceInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// UpdateLakeFormationInstance 更新实例 +// +// 修改LakeFormation实例信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) UpdateLakeFormationInstance(request *model.UpdateLakeFormationInstanceRequest) (*model.UpdateLakeFormationInstanceResponse, error) { + requestDef := GenReqDefForUpdateLakeFormationInstance() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.UpdateLakeFormationInstanceResponse), nil + } +} + +// UpdateLakeFormationInstanceInvoker 更新实例 +func (c *LakeFormationClient) UpdateLakeFormationInstanceInvoker(request *model.UpdateLakeFormationInstanceRequest) *UpdateLakeFormationInstanceInvoker { + requestDef := GenReqDefForUpdateLakeFormationInstance() + return &UpdateLakeFormationInstanceInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListObsBuckets 查询OBS桶列表 +// +// 查询OBS桶列表 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListObsBuckets(request *model.ListObsBucketsRequest) (*model.ListObsBucketsResponse, error) { + requestDef := GenReqDefForListObsBuckets() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListObsBucketsResponse), nil + } +} + +// ListObsBucketsInvoker 查询OBS桶列表 +func (c *LakeFormationClient) ListObsBucketsInvoker(request *model.ListObsBucketsRequest) *ListObsBucketsInvoker { + requestDef := GenReqDefForListObsBuckets() + return &ListObsBucketsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListObsObject 查询obs桶对象列表 +// +// 查询obs桶对象列表 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListObsObject(request *model.ListObsObjectRequest) (*model.ListObsObjectResponse, error) { + requestDef := GenReqDefForListObsObject() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListObsObjectResponse), nil + } +} + +// ListObsObjectInvoker 查询obs桶对象列表 +func (c *LakeFormationClient) ListObsObjectInvoker(request *model.ListObsObjectRequest) *ListObsObjectInvoker { + requestDef := GenReqDefForListObsObject() + return &ListObsObjectInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// AddPartitions 批量添加分区信息 +// +// 批量添加分区信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) AddPartitions(request *model.AddPartitionsRequest) (*model.AddPartitionsResponse, error) { + requestDef := GenReqDefForAddPartitions() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.AddPartitionsResponse), nil + } +} + +// AddPartitionsInvoker 批量添加分区信息 +func (c *LakeFormationClient) AddPartitionsInvoker(request *model.AddPartitionsRequest) *AddPartitionsInvoker { + requestDef := GenReqDefForAddPartitions() + return &AddPartitionsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// BatchDeletePartition 批量删除分区信息 +// +// 非事务表:如果设置删除数据,立刻删除分区数据路径下的数据。 +// 事务表:如果设置删除数据,保留数据在原路径下但对外不可见,待数据超期后统一删除。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) BatchDeletePartition(request *model.BatchDeletePartitionRequest) (*model.BatchDeletePartitionResponse, error) { + requestDef := GenReqDefForBatchDeletePartition() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.BatchDeletePartitionResponse), nil + } +} + +// BatchDeletePartitionInvoker 批量删除分区信息 +func (c *LakeFormationClient) BatchDeletePartitionInvoker(request *model.BatchDeletePartitionRequest) *BatchDeletePartitionInvoker { + requestDef := GenReqDefForBatchDeletePartition() + return &BatchDeletePartitionInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// BatchDeletePartitionedStatistics 批量清空列表信息 +// +// 删除存在分区的数据及统计信息,保留分区的元数据信息。全部存在、部分存在或都不存在,均返回OK +// 非事务表:立刻删除分区路径下的数据。 +// 事务表:数据保留但不可见,待被删除数据超期后统一删除。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) BatchDeletePartitionedStatistics(request *model.BatchDeletePartitionedStatisticsRequest) (*model.BatchDeletePartitionedStatisticsResponse, error) { + requestDef := GenReqDefForBatchDeletePartitionedStatistics() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.BatchDeletePartitionedStatisticsResponse), nil + } +} + +// BatchDeletePartitionedStatisticsInvoker 批量清空列表信息 +func (c *LakeFormationClient) BatchDeletePartitionedStatisticsInvoker(request *model.BatchDeletePartitionedStatisticsRequest) *BatchDeletePartitionedStatisticsInvoker { + requestDef := GenReqDefForBatchDeletePartitionedStatistics() + return &BatchDeletePartitionedStatisticsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// BatchListPartitionByValues 批量获取分区信息 +// +// 批量获取分区信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) BatchListPartitionByValues(request *model.BatchListPartitionByValuesRequest) (*model.BatchListPartitionByValuesResponse, error) { + requestDef := GenReqDefForBatchListPartitionByValues() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.BatchListPartitionByValuesResponse), nil + } +} + +// BatchListPartitionByValuesInvoker 批量获取分区信息 +func (c *LakeFormationClient) BatchListPartitionByValuesInvoker(request *model.BatchListPartitionByValuesRequest) *BatchListPartitionByValuesInvoker { + requestDef := GenReqDefForBatchListPartitionByValues() + return &BatchListPartitionByValuesInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// BatchUpdatePartition 批量修改分区信息 +// +// 所有partition必须要全部存在,如果存在某个partition不存在,就返回失败 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) BatchUpdatePartition(request *model.BatchUpdatePartitionRequest) (*model.BatchUpdatePartitionResponse, error) { + requestDef := GenReqDefForBatchUpdatePartition() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.BatchUpdatePartitionResponse), nil + } +} + +// BatchUpdatePartitionInvoker 批量修改分区信息 +func (c *LakeFormationClient) BatchUpdatePartitionInvoker(request *model.BatchUpdatePartitionRequest) *BatchUpdatePartitionInvoker { + requestDef := GenReqDefForBatchUpdatePartition() + return &BatchUpdatePartitionInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListPartitionNames 列举分区值列表 +// +// 遍历分区名字列表信息 +// 对于事务表,支持基于表的特定版本遍历分区名字列表。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListPartitionNames(request *model.ListPartitionNamesRequest) (*model.ListPartitionNamesResponse, error) { + requestDef := GenReqDefForListPartitionNames() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListPartitionNamesResponse), nil + } +} + +// ListPartitionNamesInvoker 列举分区值列表 +func (c *LakeFormationClient) ListPartitionNamesInvoker(request *model.ListPartitionNamesRequest) *ListPartitionNamesInvoker { + requestDef := GenReqDefForListPartitionNames() + return &ListPartitionNamesInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListPartitions 列举分区信息 +// +// 遍历指定数据表下的分区列表,对于事务表,支持基于表的特定版本遍历分区列表。 +// 当过滤条件不为空时,优先根据过滤条件筛选过滤, +// 当过滤条件为空且分区值不为空时,再根据分区值筛选过滤, +// 当过滤条件和分区值都为空时,返回指定数据表下所有分区。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListPartitions(request *model.ListPartitionsRequest) (*model.ListPartitionsResponse, error) { + requestDef := GenReqDefForListPartitions() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListPartitionsResponse), nil + } +} + +// ListPartitionsInvoker 列举分区信息 +func (c *LakeFormationClient) ListPartitionsInvoker(request *model.ListPartitionsRequest) *ListPartitionsInvoker { + requestDef := GenReqDefForListPartitions() + return &ListPartitionsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// BatchShowPartitionColumnStatistics 批量获取分区的列统计信息 +// +// 批量获取分区的列统计信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) BatchShowPartitionColumnStatistics(request *model.BatchShowPartitionColumnStatisticsRequest) (*model.BatchShowPartitionColumnStatisticsResponse, error) { + requestDef := GenReqDefForBatchShowPartitionColumnStatistics() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.BatchShowPartitionColumnStatisticsResponse), nil + } +} + +// BatchShowPartitionColumnStatisticsInvoker 批量获取分区的列统计信息 +func (c *LakeFormationClient) BatchShowPartitionColumnStatisticsInvoker(request *model.BatchShowPartitionColumnStatisticsRequest) *BatchShowPartitionColumnStatisticsInvoker { + requestDef := GenReqDefForBatchShowPartitionColumnStatistics() + return &BatchShowPartitionColumnStatisticsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeletePartitionColumnStatistics 删除分区列的统计信息 +// +// 删除分区列的统计信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) DeletePartitionColumnStatistics(request *model.DeletePartitionColumnStatisticsRequest) (*model.DeletePartitionColumnStatisticsResponse, error) { + requestDef := GenReqDefForDeletePartitionColumnStatistics() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeletePartitionColumnStatisticsResponse), nil + } +} + +// DeletePartitionColumnStatisticsInvoker 删除分区列的统计信息 +func (c *LakeFormationClient) DeletePartitionColumnStatisticsInvoker(request *model.DeletePartitionColumnStatisticsRequest) *DeletePartitionColumnStatisticsInvoker { + requestDef := GenReqDefForDeletePartitionColumnStatistics() + return &DeletePartitionColumnStatisticsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// SetPartitionColumnStatistics 批量设置分区的统计信息 +// +// 批量设置分区的统计信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) SetPartitionColumnStatistics(request *model.SetPartitionColumnStatisticsRequest) (*model.SetPartitionColumnStatisticsResponse, error) { + requestDef := GenReqDefForSetPartitionColumnStatistics() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.SetPartitionColumnStatisticsResponse), nil + } +} + +// SetPartitionColumnStatisticsInvoker 批量设置分区的统计信息 +func (c *LakeFormationClient) SetPartitionColumnStatisticsInvoker(request *model.SetPartitionColumnStatisticsRequest) *SetPartitionColumnStatisticsInvoker { + requestDef := GenReqDefForSetPartitionColumnStatistics() + return &SetPartitionColumnStatisticsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// CreateRole 创建role +// +// 创建role +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) CreateRole(request *model.CreateRoleRequest) (*model.CreateRoleResponse, error) { + requestDef := GenReqDefForCreateRole() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.CreateRoleResponse), nil + } +} + +// CreateRoleInvoker 创建role +func (c *LakeFormationClient) CreateRoleInvoker(request *model.CreateRoleRequest) *CreateRoleInvoker { + requestDef := GenReqDefForCreateRole() + return &CreateRoleInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeleteRole 删除角色 +// +// 删除指定角色 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) DeleteRole(request *model.DeleteRoleRequest) (*model.DeleteRoleResponse, error) { + requestDef := GenReqDefForDeleteRole() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeleteRoleResponse), nil + } +} + +// DeleteRoleInvoker 删除角色 +func (c *LakeFormationClient) DeleteRoleInvoker(request *model.DeleteRoleRequest) *DeleteRoleInvoker { + requestDef := GenReqDefForDeleteRole() + return &DeleteRoleInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListRoleNames 列举所有角色名 +// +// 查询所有角色名字列表 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListRoleNames(request *model.ListRoleNamesRequest) (*model.ListRoleNamesResponse, error) { + requestDef := GenReqDefForListRoleNames() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListRoleNamesResponse), nil + } +} + +// ListRoleNamesInvoker 列举所有角色名 +func (c *LakeFormationClient) ListRoleNamesInvoker(request *model.ListRoleNamesRequest) *ListRoleNamesInvoker { + requestDef := GenReqDefForListRoleNames() + return &ListRoleNamesInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListRoles 根据条件分页列举角色 +// +// 返回所有角色 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListRoles(request *model.ListRolesRequest) (*model.ListRolesResponse, error) { + requestDef := GenReqDefForListRoles() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListRolesResponse), nil + } +} + +// ListRolesInvoker 根据条件分页列举角色 +func (c *LakeFormationClient) ListRolesInvoker(request *model.ListRolesRequest) *ListRolesInvoker { + requestDef := GenReqDefForListRoles() + return &ListRolesInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ShowRole 获取角色 +// +// 获取角色 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ShowRole(request *model.ShowRoleRequest) (*model.ShowRoleResponse, error) { + requestDef := GenReqDefForShowRole() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ShowRoleResponse), nil + } +} + +// ShowRoleInvoker 获取角色 +func (c *LakeFormationClient) ShowRoleInvoker(request *model.ShowRoleRequest) *ShowRoleInvoker { + requestDef := GenReqDefForShowRole() + return &ShowRoleInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// UpdateRole 修改角色信息 +// +// 修改角色信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) UpdateRole(request *model.UpdateRoleRequest) (*model.UpdateRoleResponse, error) { + requestDef := GenReqDefForUpdateRole() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.UpdateRoleResponse), nil + } +} + +// UpdateRoleInvoker 修改角色信息 +func (c *LakeFormationClient) UpdateRoleInvoker(request *model.UpdateRoleRequest) *UpdateRoleInvoker { + requestDef := GenReqDefForUpdateRole() + return &UpdateRoleInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListSpecs +// +// 查询规格列表 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListSpecs(request *model.ListSpecsRequest) (*model.ListSpecsResponse, error) { + requestDef := GenReqDefForListSpecs() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListSpecsResponse), nil + } +} + +// ListSpecsInvoker +func (c *LakeFormationClient) ListSpecsInvoker(request *model.ListSpecsRequest) *ListSpecsInvoker { + requestDef := GenReqDefForListSpecs() + return &ListSpecsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// CreateTable 创建表 +// +// 创建表操作 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) CreateTable(request *model.CreateTableRequest) (*model.CreateTableResponse, error) { + requestDef := GenReqDefForCreateTable() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.CreateTableResponse), nil + } +} + +// CreateTableInvoker 创建表 +func (c *LakeFormationClient) CreateTableInvoker(request *model.CreateTableRequest) *CreateTableInvoker { + requestDef := GenReqDefForCreateTable() + return &CreateTableInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeleteAllTables 清空表的数据 +// +// 清空表以及表下所有分区的数据及统计信息。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) DeleteAllTables(request *model.DeleteAllTablesRequest) (*model.DeleteAllTablesResponse, error) { + requestDef := GenReqDefForDeleteAllTables() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeleteAllTablesResponse), nil + } +} + +// DeleteAllTablesInvoker 清空表的数据 +func (c *LakeFormationClient) DeleteAllTablesInvoker(request *model.DeleteAllTablesRequest) *DeleteAllTablesInvoker { + requestDef := GenReqDefForDeleteAllTables() + return &DeleteAllTablesInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeleteTable 删除表 +// +// 删除表及表下的分区 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) DeleteTable(request *model.DeleteTableRequest) (*model.DeleteTableResponse, error) { + requestDef := GenReqDefForDeleteTable() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeleteTableResponse), nil + } +} + +// DeleteTableInvoker 删除表 +func (c *LakeFormationClient) DeleteTableInvoker(request *model.DeleteTableRequest) *DeleteTableInvoker { + requestDef := GenReqDefForDeleteTable() + return &DeleteTableInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListTableMeta 分页获取表的描述信息 +// +// 通过数据库通配符和表通配符,找到符合条件的表并返回表的描述信息。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListTableMeta(request *model.ListTableMetaRequest) (*model.ListTableMetaResponse, error) { + requestDef := GenReqDefForListTableMeta() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListTableMetaResponse), nil + } +} + +// ListTableMetaInvoker 分页获取表的描述信息 +func (c *LakeFormationClient) ListTableMetaInvoker(request *model.ListTableMetaRequest) *ListTableMetaInvoker { + requestDef := GenReqDefForListTableMeta() + return &ListTableMetaInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListTableNames 列举库下所有表名 +// +// 查询数据库下的所有表名字列表 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListTableNames(request *model.ListTableNamesRequest) (*model.ListTableNamesResponse, error) { + requestDef := GenReqDefForListTableNames() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListTableNamesResponse), nil + } +} + +// ListTableNamesInvoker 列举库下所有表名 +func (c *LakeFormationClient) ListTableNamesInvoker(request *model.ListTableNamesRequest) *ListTableNamesInvoker { + requestDef := GenReqDefForListTableNames() + return &ListTableNamesInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListTables 根据条件分页列举表信息 +// +// 返回数据库下符合查询条件的表的元数据信息,不支持事务操作 +// 当表名通配符或表类型不为空时,优先根据表名和类型筛选过滤 +// 当表名通配符或表类型为空时,再根据属性筛选过滤 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListTables(request *model.ListTablesRequest) (*model.ListTablesResponse, error) { + requestDef := GenReqDefForListTables() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListTablesResponse), nil + } +} + +// ListTablesInvoker 根据条件分页列举表信息 +func (c *LakeFormationClient) ListTablesInvoker(request *model.ListTablesRequest) *ListTablesInvoker { + requestDef := GenReqDefForListTables() + return &ListTablesInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListTablesByName 根据表名列举表信息 +// +// 根据表名查询数据库下的表信息列表 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListTablesByName(request *model.ListTablesByNameRequest) (*model.ListTablesByNameResponse, error) { + requestDef := GenReqDefForListTablesByName() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListTablesByNameResponse), nil + } +} + +// ListTablesByNameInvoker 根据表名列举表信息 +func (c *LakeFormationClient) ListTablesByNameInvoker(request *model.ListTablesByNameRequest) *ListTablesByNameInvoker { + requestDef := GenReqDefForListTablesByName() + return &ListTablesByNameInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ShowTable 获取表信息 +// +// 获取表信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ShowTable(request *model.ShowTableRequest) (*model.ShowTableResponse, error) { + requestDef := GenReqDefForShowTable() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ShowTableResponse), nil + } +} + +// ShowTableInvoker 获取表信息 +func (c *LakeFormationClient) ShowTableInvoker(request *model.ShowTableRequest) *ShowTableInvoker { + requestDef := GenReqDefForShowTable() + return &ShowTableInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// UpdateTable 修改表信息 +// +// 修改表信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) UpdateTable(request *model.UpdateTableRequest) (*model.UpdateTableResponse, error) { + requestDef := GenReqDefForUpdateTable() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.UpdateTableResponse), nil + } +} + +// UpdateTableInvoker 修改表信息 +func (c *LakeFormationClient) UpdateTableInvoker(request *model.UpdateTableRequest) *UpdateTableInvoker { + requestDef := GenReqDefForUpdateTable() + return &UpdateTableInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeleteTableColumnStatistics 删除表的指定列统计信息 +// +// 删除表的指定列统计信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) DeleteTableColumnStatistics(request *model.DeleteTableColumnStatisticsRequest) (*model.DeleteTableColumnStatisticsResponse, error) { + requestDef := GenReqDefForDeleteTableColumnStatistics() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeleteTableColumnStatisticsResponse), nil + } +} + +// DeleteTableColumnStatisticsInvoker 删除表的指定列统计信息 +func (c *LakeFormationClient) DeleteTableColumnStatisticsInvoker(request *model.DeleteTableColumnStatisticsRequest) *DeleteTableColumnStatisticsInvoker { + requestDef := GenReqDefForDeleteTableColumnStatistics() + return &DeleteTableColumnStatisticsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListTableColumnStatistics 获取表的列统计信息 +// +// 获取表的列统计信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListTableColumnStatistics(request *model.ListTableColumnStatisticsRequest) (*model.ListTableColumnStatisticsResponse, error) { + requestDef := GenReqDefForListTableColumnStatistics() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListTableColumnStatisticsResponse), nil + } +} + +// ListTableColumnStatisticsInvoker 获取表的列统计信息 +func (c *LakeFormationClient) ListTableColumnStatisticsInvoker(request *model.ListTableColumnStatisticsRequest) *ListTableColumnStatisticsInvoker { + requestDef := GenReqDefForListTableColumnStatistics() + return &ListTableColumnStatisticsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// SetTableColumnStatistics 更新表的列统计信息 +// +// 更新表的列统计信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) SetTableColumnStatistics(request *model.SetTableColumnStatisticsRequest) (*model.SetTableColumnStatisticsResponse, error) { + requestDef := GenReqDefForSetTableColumnStatistics() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.SetTableColumnStatisticsResponse), nil + } +} + +// SetTableColumnStatisticsInvoker 更新表的列统计信息 +func (c *LakeFormationClient) SetTableColumnStatisticsInvoker(request *model.SetTableColumnStatisticsRequest) *SetTableColumnStatisticsInvoker { + requestDef := GenReqDefForSetTableColumnStatistics() + return &SetTableColumnStatisticsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// BatchCreateConstraint 批量创建列限制条件 +// +// 批量创建表的列限制条件 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) BatchCreateConstraint(request *model.BatchCreateConstraintRequest) (*model.BatchCreateConstraintResponse, error) { + requestDef := GenReqDefForBatchCreateConstraint() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.BatchCreateConstraintResponse), nil + } +} + +// BatchCreateConstraintInvoker 批量创建列限制条件 +func (c *LakeFormationClient) BatchCreateConstraintInvoker(request *model.BatchCreateConstraintRequest) *BatchCreateConstraintInvoker { + requestDef := GenReqDefForBatchCreateConstraint() + return &BatchCreateConstraintInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeleteConstraint 删除列限制条件 +// +// 删除列限制条件 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) DeleteConstraint(request *model.DeleteConstraintRequest) (*model.DeleteConstraintResponse, error) { + requestDef := GenReqDefForDeleteConstraint() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeleteConstraintResponse), nil + } +} + +// DeleteConstraintInvoker 删除列限制条件 +func (c *LakeFormationClient) DeleteConstraintInvoker(request *model.DeleteConstraintRequest) *DeleteConstraintInvoker { + requestDef := GenReqDefForDeleteConstraint() + return &DeleteConstraintInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListConstraints 获取列限制条件 +// +// 若查询外键信息,需要在参数中填写被引用表的数据库名和表名。如:parent_db=db1&parent_tbl=tbl1 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListConstraints(request *model.ListConstraintsRequest) (*model.ListConstraintsResponse, error) { + requestDef := GenReqDefForListConstraints() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListConstraintsResponse), nil + } +} + +// ListConstraintsInvoker 获取列限制条件 +func (c *LakeFormationClient) ListConstraintsInvoker(request *model.ListConstraintsRequest) *ListConstraintsInvoker { + requestDef := GenReqDefForListConstraints() + return &ListConstraintsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// BatchUpdateLakeFormationInstanceTags 批量更新标签 +// +// 为指定实例批量更新标签 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) BatchUpdateLakeFormationInstanceTags(request *model.BatchUpdateLakeFormationInstanceTagsRequest) (*model.BatchUpdateLakeFormationInstanceTagsResponse, error) { + requestDef := GenReqDefForBatchUpdateLakeFormationInstanceTags() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.BatchUpdateLakeFormationInstanceTagsResponse), nil + } +} + +// BatchUpdateLakeFormationInstanceTagsInvoker 批量更新标签 +func (c *LakeFormationClient) BatchUpdateLakeFormationInstanceTagsInvoker(request *model.BatchUpdateLakeFormationInstanceTagsRequest) *BatchUpdateLakeFormationInstanceTagsInvoker { + requestDef := GenReqDefForBatchUpdateLakeFormationInstanceTags() + return &BatchUpdateLakeFormationInstanceTagsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListGroupsForDomain 获取租户的用户组 +// +// 获取租户的用户组 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *LakeFormationClient) ListGroupsForDomain(request *model.ListGroupsForDomainRequest) (*model.ListGroupsForDomainResponse, error) { + requestDef := GenReqDefForListGroupsForDomain() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListGroupsForDomainResponse), nil + } +} + +// ListGroupsForDomainInvoker 获取租户的用户组 +func (c *LakeFormationClient) ListGroupsForDomainInvoker(request *model.ListGroupsForDomainRequest) *ListGroupsForDomainInvoker { + requestDef := GenReqDefForListGroupsForDomain() + return &ListGroupsForDomainInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/lakeFormation_invoker.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/lakeFormation_invoker.go new file mode 100644 index 00000000..1e7141b1 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/lakeFormation_invoker.go @@ -0,0 +1,846 @@ +package v1 + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/invoker" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model" +) + +type ApplyForAccessInvoker struct { + *invoker.BaseInvoker +} + +func (i *ApplyForAccessInvoker) Invoke() (*model.ApplyForAccessResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ApplyForAccessResponse), nil + } +} + +type BatchAuthorizeInterfaceInvoker struct { + *invoker.BaseInvoker +} + +func (i *BatchAuthorizeInterfaceInvoker) Invoke() (*model.BatchAuthorizeInterfaceResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.BatchAuthorizeInterfaceResponse), nil + } +} + +type BatchCancelAuthorizationInterfaceInvoker struct { + *invoker.BaseInvoker +} + +func (i *BatchCancelAuthorizationInterfaceInvoker) Invoke() (*model.BatchCancelAuthorizationInterfaceResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.BatchCancelAuthorizationInterfaceResponse), nil + } +} + +type ListAccessInfosInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListAccessInfosInvoker) Invoke() (*model.ListAccessInfosResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListAccessInfosResponse), nil + } +} + +type ListInterfacesInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListInterfacesInvoker) Invoke() (*model.ListInterfacesResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListInterfacesResponse), nil + } +} + +type ListPolicyInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListPolicyInvoker) Invoke() (*model.ListPolicyResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListPolicyResponse), nil + } +} + +type ShowSyncPolicyInvoker struct { + *invoker.BaseInvoker +} + +func (i *ShowSyncPolicyInvoker) Invoke() (*model.ShowSyncPolicyResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ShowSyncPolicyResponse), nil + } +} + +type CreateCatalogInvoker struct { + *invoker.BaseInvoker +} + +func (i *CreateCatalogInvoker) Invoke() (*model.CreateCatalogResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.CreateCatalogResponse), nil + } +} + +type DeleteCatalogInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeleteCatalogInvoker) Invoke() (*model.DeleteCatalogResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeleteCatalogResponse), nil + } +} + +type ListCatalogsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListCatalogsInvoker) Invoke() (*model.ListCatalogsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListCatalogsResponse), nil + } +} + +type ShowCatalogInvoker struct { + *invoker.BaseInvoker +} + +func (i *ShowCatalogInvoker) Invoke() (*model.ShowCatalogResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ShowCatalogResponse), nil + } +} + +type UpdateCatalogInvoker struct { + *invoker.BaseInvoker +} + +func (i *UpdateCatalogInvoker) Invoke() (*model.UpdateCatalogResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.UpdateCatalogResponse), nil + } +} + +type CreateDatabaseInvoker struct { + *invoker.BaseInvoker +} + +func (i *CreateDatabaseInvoker) Invoke() (*model.CreateDatabaseResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.CreateDatabaseResponse), nil + } +} + +type DeleteDatabaseInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeleteDatabaseInvoker) Invoke() (*model.DeleteDatabaseResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeleteDatabaseResponse), nil + } +} + +type ListDatabaseNamesInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListDatabaseNamesInvoker) Invoke() (*model.ListDatabaseNamesResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListDatabaseNamesResponse), nil + } +} + +type ListDatabasesInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListDatabasesInvoker) Invoke() (*model.ListDatabasesResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListDatabasesResponse), nil + } +} + +type ShowDatabaseInvoker struct { + *invoker.BaseInvoker +} + +func (i *ShowDatabaseInvoker) Invoke() (*model.ShowDatabaseResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ShowDatabaseResponse), nil + } +} + +type UpdateDatabaseInvoker struct { + *invoker.BaseInvoker +} + +func (i *UpdateDatabaseInvoker) Invoke() (*model.UpdateDatabaseResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.UpdateDatabaseResponse), nil + } +} + +type CreateFunctionInvoker struct { + *invoker.BaseInvoker +} + +func (i *CreateFunctionInvoker) Invoke() (*model.CreateFunctionResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.CreateFunctionResponse), nil + } +} + +type DeleteFunctionInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeleteFunctionInvoker) Invoke() (*model.DeleteFunctionResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeleteFunctionResponse), nil + } +} + +type ListAllFunctionsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListAllFunctionsInvoker) Invoke() (*model.ListAllFunctionsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListAllFunctionsResponse), nil + } +} + +type ListFunctionsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListFunctionsInvoker) Invoke() (*model.ListFunctionsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListFunctionsResponse), nil + } +} + +type ShowFunctionInvoker struct { + *invoker.BaseInvoker +} + +func (i *ShowFunctionInvoker) Invoke() (*model.ShowFunctionResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ShowFunctionResponse), nil + } +} + +type UpdateFunctionInvoker struct { + *invoker.BaseInvoker +} + +func (i *UpdateFunctionInvoker) Invoke() (*model.UpdateFunctionResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.UpdateFunctionResponse), nil + } +} + +type CreateAgreementInvoker struct { + *invoker.BaseInvoker +} + +func (i *CreateAgreementInvoker) Invoke() (*model.CreateAgreementResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.CreateAgreementResponse), nil + } +} + +type ShowAgreementInvoker struct { + *invoker.BaseInvoker +} + +func (i *ShowAgreementInvoker) Invoke() (*model.ShowAgreementResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ShowAgreementResponse), nil + } +} + +type ShowAgreementRuleInvoker struct { + *invoker.BaseInvoker +} + +func (i *ShowAgreementRuleInvoker) Invoke() (*model.ShowAgreementRuleResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ShowAgreementRuleResponse), nil + } +} + +type CountMetaObjInvoker struct { + *invoker.BaseInvoker +} + +func (i *CountMetaObjInvoker) Invoke() (*model.CountMetaObjResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.CountMetaObjResponse), nil + } +} + +type CreateLakeFormationInstanceInvoker struct { + *invoker.BaseInvoker +} + +func (i *CreateLakeFormationInstanceInvoker) Invoke() (*model.CreateLakeFormationInstanceResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.CreateLakeFormationInstanceResponse), nil + } +} + +type DeleteLakeFormationInstanceInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeleteLakeFormationInstanceInvoker) Invoke() (*model.DeleteLakeFormationInstanceResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeleteLakeFormationInstanceResponse), nil + } +} + +type ListLakeFormationInstancesInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListLakeFormationInstancesInvoker) Invoke() (*model.ListLakeFormationInstancesResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListLakeFormationInstancesResponse), nil + } +} + +type MoveLakeFormationInstanceOutRecycleBinInvoker struct { + *invoker.BaseInvoker +} + +func (i *MoveLakeFormationInstanceOutRecycleBinInvoker) Invoke() (*model.MoveLakeFormationInstanceOutRecycleBinResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.MoveLakeFormationInstanceOutRecycleBinResponse), nil + } +} + +type ShowLakeFormationInstanceInvoker struct { + *invoker.BaseInvoker +} + +func (i *ShowLakeFormationInstanceInvoker) Invoke() (*model.ShowLakeFormationInstanceResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ShowLakeFormationInstanceResponse), nil + } +} + +type UpdateLakeFormationInstanceInvoker struct { + *invoker.BaseInvoker +} + +func (i *UpdateLakeFormationInstanceInvoker) Invoke() (*model.UpdateLakeFormationInstanceResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.UpdateLakeFormationInstanceResponse), nil + } +} + +type ListObsBucketsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListObsBucketsInvoker) Invoke() (*model.ListObsBucketsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListObsBucketsResponse), nil + } +} + +type ListObsObjectInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListObsObjectInvoker) Invoke() (*model.ListObsObjectResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListObsObjectResponse), nil + } +} + +type AddPartitionsInvoker struct { + *invoker.BaseInvoker +} + +func (i *AddPartitionsInvoker) Invoke() (*model.AddPartitionsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.AddPartitionsResponse), nil + } +} + +type BatchDeletePartitionInvoker struct { + *invoker.BaseInvoker +} + +func (i *BatchDeletePartitionInvoker) Invoke() (*model.BatchDeletePartitionResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.BatchDeletePartitionResponse), nil + } +} + +type BatchDeletePartitionedStatisticsInvoker struct { + *invoker.BaseInvoker +} + +func (i *BatchDeletePartitionedStatisticsInvoker) Invoke() (*model.BatchDeletePartitionedStatisticsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.BatchDeletePartitionedStatisticsResponse), nil + } +} + +type BatchListPartitionByValuesInvoker struct { + *invoker.BaseInvoker +} + +func (i *BatchListPartitionByValuesInvoker) Invoke() (*model.BatchListPartitionByValuesResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.BatchListPartitionByValuesResponse), nil + } +} + +type BatchUpdatePartitionInvoker struct { + *invoker.BaseInvoker +} + +func (i *BatchUpdatePartitionInvoker) Invoke() (*model.BatchUpdatePartitionResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.BatchUpdatePartitionResponse), nil + } +} + +type ListPartitionNamesInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListPartitionNamesInvoker) Invoke() (*model.ListPartitionNamesResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListPartitionNamesResponse), nil + } +} + +type ListPartitionsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListPartitionsInvoker) Invoke() (*model.ListPartitionsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListPartitionsResponse), nil + } +} + +type BatchShowPartitionColumnStatisticsInvoker struct { + *invoker.BaseInvoker +} + +func (i *BatchShowPartitionColumnStatisticsInvoker) Invoke() (*model.BatchShowPartitionColumnStatisticsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.BatchShowPartitionColumnStatisticsResponse), nil + } +} + +type DeletePartitionColumnStatisticsInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeletePartitionColumnStatisticsInvoker) Invoke() (*model.DeletePartitionColumnStatisticsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeletePartitionColumnStatisticsResponse), nil + } +} + +type SetPartitionColumnStatisticsInvoker struct { + *invoker.BaseInvoker +} + +func (i *SetPartitionColumnStatisticsInvoker) Invoke() (*model.SetPartitionColumnStatisticsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.SetPartitionColumnStatisticsResponse), nil + } +} + +type CreateRoleInvoker struct { + *invoker.BaseInvoker +} + +func (i *CreateRoleInvoker) Invoke() (*model.CreateRoleResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.CreateRoleResponse), nil + } +} + +type DeleteRoleInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeleteRoleInvoker) Invoke() (*model.DeleteRoleResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeleteRoleResponse), nil + } +} + +type ListRoleNamesInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListRoleNamesInvoker) Invoke() (*model.ListRoleNamesResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListRoleNamesResponse), nil + } +} + +type ListRolesInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListRolesInvoker) Invoke() (*model.ListRolesResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListRolesResponse), nil + } +} + +type ShowRoleInvoker struct { + *invoker.BaseInvoker +} + +func (i *ShowRoleInvoker) Invoke() (*model.ShowRoleResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ShowRoleResponse), nil + } +} + +type UpdateRoleInvoker struct { + *invoker.BaseInvoker +} + +func (i *UpdateRoleInvoker) Invoke() (*model.UpdateRoleResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.UpdateRoleResponse), nil + } +} + +type ListSpecsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListSpecsInvoker) Invoke() (*model.ListSpecsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListSpecsResponse), nil + } +} + +type CreateTableInvoker struct { + *invoker.BaseInvoker +} + +func (i *CreateTableInvoker) Invoke() (*model.CreateTableResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.CreateTableResponse), nil + } +} + +type DeleteAllTablesInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeleteAllTablesInvoker) Invoke() (*model.DeleteAllTablesResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeleteAllTablesResponse), nil + } +} + +type DeleteTableInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeleteTableInvoker) Invoke() (*model.DeleteTableResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeleteTableResponse), nil + } +} + +type ListTableMetaInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListTableMetaInvoker) Invoke() (*model.ListTableMetaResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListTableMetaResponse), nil + } +} + +type ListTableNamesInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListTableNamesInvoker) Invoke() (*model.ListTableNamesResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListTableNamesResponse), nil + } +} + +type ListTablesInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListTablesInvoker) Invoke() (*model.ListTablesResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListTablesResponse), nil + } +} + +type ListTablesByNameInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListTablesByNameInvoker) Invoke() (*model.ListTablesByNameResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListTablesByNameResponse), nil + } +} + +type ShowTableInvoker struct { + *invoker.BaseInvoker +} + +func (i *ShowTableInvoker) Invoke() (*model.ShowTableResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ShowTableResponse), nil + } +} + +type UpdateTableInvoker struct { + *invoker.BaseInvoker +} + +func (i *UpdateTableInvoker) Invoke() (*model.UpdateTableResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.UpdateTableResponse), nil + } +} + +type DeleteTableColumnStatisticsInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeleteTableColumnStatisticsInvoker) Invoke() (*model.DeleteTableColumnStatisticsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeleteTableColumnStatisticsResponse), nil + } +} + +type ListTableColumnStatisticsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListTableColumnStatisticsInvoker) Invoke() (*model.ListTableColumnStatisticsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListTableColumnStatisticsResponse), nil + } +} + +type SetTableColumnStatisticsInvoker struct { + *invoker.BaseInvoker +} + +func (i *SetTableColumnStatisticsInvoker) Invoke() (*model.SetTableColumnStatisticsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.SetTableColumnStatisticsResponse), nil + } +} + +type BatchCreateConstraintInvoker struct { + *invoker.BaseInvoker +} + +func (i *BatchCreateConstraintInvoker) Invoke() (*model.BatchCreateConstraintResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.BatchCreateConstraintResponse), nil + } +} + +type DeleteConstraintInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeleteConstraintInvoker) Invoke() (*model.DeleteConstraintResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeleteConstraintResponse), nil + } +} + +type ListConstraintsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListConstraintsInvoker) Invoke() (*model.ListConstraintsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListConstraintsResponse), nil + } +} + +type BatchUpdateLakeFormationInstanceTagsInvoker struct { + *invoker.BaseInvoker +} + +func (i *BatchUpdateLakeFormationInstanceTagsInvoker) Invoke() (*model.BatchUpdateLakeFormationInstanceTagsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.BatchUpdateLakeFormationInstanceTagsResponse), nil + } +} + +type ListGroupsForDomainInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListGroupsForDomainInvoker) Invoke() (*model.ListGroupsForDomainResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListGroupsForDomainResponse), nil + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/lakeFormation_meta.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/lakeFormation_meta.go new file mode 100644 index 00000000..9a9f36ac --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/lakeFormation_meta.go @@ -0,0 +1,2052 @@ +package v1 + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/def" + + "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model" + "net/http" +) + +func GenReqDefForApplyForAccess() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/access"). + WithResponse(new(model.ApplyForAccessResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForBatchAuthorizeInterface() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/policies/grant"). + WithResponse(new(model.BatchAuthorizeInterfaceResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForBatchCancelAuthorizationInterface() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/policies/revoke"). + WithResponse(new(model.BatchCancelAuthorizationInterfaceResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListAccessInfos() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/access"). + WithResponse(new(model.ListAccessInfosResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Offset"). + WithJsonTag("offset"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListInterfaces() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/policies/show"). + WithResponse(new(model.ListInterfacesResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Filter"). + WithJsonTag("filter"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ResourceName"). + WithJsonTag("resource_name"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ResourceType"). + WithJsonTag("resource_type"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("PrincipalSource"). + WithJsonTag("principal_source"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("PrincipalType"). + WithJsonTag("principal_type"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("PrincipalName"). + WithJsonTag("principal_name"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Marker"). + WithJsonTag("marker"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListPolicy() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/policies"). + WithResponse(new(model.ListPolicyResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Marker"). + WithJsonTag("marker"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ReversePage"). + WithJsonTag("reverse_page"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForShowSyncPolicy() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/policies/policy"). + WithResponse(new(model.ShowSyncPolicyResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("LastKnownVersion"). + WithJsonTag("last_known_version"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("SupportsPolicyDeltas"). + WithJsonTag("supports_policy_deltas"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("IsReturnPolicyData"). + WithJsonTag("is_return_policy_data"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForCreateCatalog() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs"). + WithResponse(new(model.CreateCatalogResponse)). + WithContentType("application/json;charset=UTF-8") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeleteCatalog() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodDelete). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}"). + WithResponse(new(model.DeleteCatalogResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListCatalogs() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs"). + WithResponse(new(model.ListCatalogsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForShowCatalog() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}"). + WithResponse(new(model.ShowCatalogResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForUpdateCatalog() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPut). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}"). + WithResponse(new(model.UpdateCatalogResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForCreateDatabase() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases"). + WithResponse(new(model.CreateDatabaseResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeleteDatabase() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodDelete). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}"). + WithResponse(new(model.DeleteDatabaseResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DeleteData"). + WithJsonTag("delete_data"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Cascade"). + WithJsonTag("cascade"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListDatabaseNames() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/names"). + WithResponse(new(model.ListDatabaseNamesResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabasePattern"). + WithJsonTag("database_pattern"). + WithLocationType(def.Query)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListDatabases() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases"). + WithResponse(new(model.ListDatabasesResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseNamePattern"). + WithJsonTag("database_name_pattern"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Marker"). + WithJsonTag("marker"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ReversePage"). + WithJsonTag("reverse_page"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForShowDatabase() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}"). + WithResponse(new(model.ShowDatabaseResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForUpdateDatabase() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPut). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}"). + WithResponse(new(model.UpdateDatabaseResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForCreateFunction() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/functions"). + WithResponse(new(model.CreateFunctionResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeleteFunction() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodDelete). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/functions/{function_name}"). + WithResponse(new(model.DeleteFunctionResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("FunctionName"). + WithJsonTag("function_name"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListAllFunctions() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/functions"). + WithResponse(new(model.ListAllFunctionsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Marker"). + WithJsonTag("marker"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ReversePage"). + WithJsonTag("reverse_page"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListFunctions() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/functions"). + WithResponse(new(model.ListFunctionsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("FunctionNamePattern"). + WithJsonTag("function_name_pattern"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Marker"). + WithJsonTag("marker"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ReversePage"). + WithJsonTag("reverse_page"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForShowFunction() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/functions/{function_name}"). + WithResponse(new(model.ShowFunctionResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("FunctionName"). + WithJsonTag("function_name"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForUpdateFunction() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/functions/{function_name}"). + WithResponse(new(model.UpdateFunctionResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("FunctionName"). + WithJsonTag("function_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForCreateAgreement() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/agreement"). + WithResponse(new(model.CreateAgreementResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("XRequestId"). + WithJsonTag("X-request-id"). + WithKindName("string"). + WithLocationType(def.Header)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForShowAgreement() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/agreement"). + WithResponse(new(model.ShowAgreementResponse)). + WithContentType("application/json") + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("XRequestId"). + WithJsonTag("X-request-id"). + WithKindName("string"). + WithLocationType(def.Header)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForShowAgreementRule() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/agreement-rule"). + WithResponse(new(model.ShowAgreementRuleResponse)). + WithContentType("application/json") + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("XRequestId"). + WithJsonTag("X-request-id"). + WithKindName("string"). + WithLocationType(def.Header)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForCountMetaObj() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/metaobj/count"). + WithResponse(new(model.CountMetaObjResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForCreateLakeFormationInstance() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances"). + WithResponse(new(model.CreateLakeFormationInstanceResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("XRequestId"). + WithJsonTag("X-request-id"). + WithKindName("string"). + WithLocationType(def.Header)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeleteLakeFormationInstance() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodDelete). + WithPath("/v1/{project_id}/instances/{instance_id}"). + WithResponse(new(model.DeleteLakeFormationInstanceResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ToRecycleBin"). + WithJsonTag("to_recycle_bin"). + WithLocationType(def.Query)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("XRequestId"). + WithJsonTag("X-request-id"). + WithKindName("string"). + WithLocationType(def.Header)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListLakeFormationInstances() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances"). + WithResponse(new(model.ListLakeFormationInstancesResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InRecycleBin"). + WithJsonTag("in_recycle_bin"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Offset"). + WithJsonTag("offset"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Name"). + WithJsonTag("name"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("EnterpriseProjectId"). + WithJsonTag("enterprise_project_id"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Tags"). + WithJsonTag("tags"). + WithLocationType(def.Query)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("XRequestId"). + WithJsonTag("X-request-id"). + WithKindName("string"). + WithLocationType(def.Header)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForMoveLakeFormationInstanceOutRecycleBin() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/recover"). + WithResponse(new(model.MoveLakeFormationInstanceOutRecycleBinResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("XRequestId"). + WithJsonTag("X-request-id"). + WithKindName("string"). + WithLocationType(def.Header)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForShowLakeFormationInstance() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}"). + WithResponse(new(model.ShowLakeFormationInstanceResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("XRequestId"). + WithJsonTag("X-request-id"). + WithKindName("string"). + WithLocationType(def.Header)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForUpdateLakeFormationInstance() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPut). + WithPath("/v1/{project_id}/instances/{instance_id}"). + WithResponse(new(model.UpdateLakeFormationInstanceResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListObsBuckets() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/obs/buckets"). + WithResponse(new(model.ListObsBucketsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Offset"). + WithJsonTag("offset"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("XRequestId"). + WithJsonTag("X-request-id"). + WithKindName("string"). + WithLocationType(def.Header)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListObsObject() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/obs/buckets/{bucket_name}"). + WithResponse(new(model.ListObsObjectResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("BucketName"). + WithJsonTag("bucket_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Marker"). + WithJsonTag("marker"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Prefix"). + WithJsonTag("prefix"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForAddPartitions() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/partitions/batch-create"). + WithResponse(new(model.AddPartitionsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForBatchDeletePartition() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/partitions/batch-drop"). + WithResponse(new(model.BatchDeletePartitionResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForBatchDeletePartitionedStatistics() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/partitions/batch-truncate"). + WithResponse(new(model.BatchDeletePartitionedStatisticsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForBatchListPartitionByValues() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/partitions/batch-get"). + WithResponse(new(model.BatchListPartitionByValuesResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForBatchUpdatePartition() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/partitions/batch-alter"). + WithResponse(new(model.BatchUpdatePartitionResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListPartitionNames() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/partitions/partition-names"). + WithResponse(new(model.ListPartitionNamesResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Filter"). + WithJsonTag("filter"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Marker"). + WithJsonTag("marker"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ReversePage"). + WithJsonTag("reverse_page"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListPartitions() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/partitions"). + WithResponse(new(model.ListPartitionsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Filter"). + WithJsonTag("filter"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("PartitionValues"). + WithJsonTag("partition_values"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Marker"). + WithJsonTag("marker"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ReversePage"). + WithJsonTag("reverse_page"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForBatchShowPartitionColumnStatistics() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/partitions/column-statistics/batch-get"). + WithResponse(new(model.BatchShowPartitionColumnStatisticsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeletePartitionColumnStatistics() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodDelete). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/partitions/column-statistics"). + WithResponse(new(model.DeletePartitionColumnStatisticsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("PartitionValues"). + WithJsonTag("partition_values"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ColumnName"). + WithJsonTag("column_name"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForSetPartitionColumnStatistics() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/partitions/column-statistics"). + WithResponse(new(model.SetPartitionColumnStatisticsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForCreateRole() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/roles"). + WithResponse(new(model.CreateRoleResponse)). + WithContentType("application/json;charset=UTF-8") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeleteRole() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodDelete). + WithPath("/v1/{project_id}/instances/{instance_id}/roles/{role_name}"). + WithResponse(new(model.DeleteRoleResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("RoleName"). + WithJsonTag("role_name"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListRoleNames() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/roles/names"). + WithResponse(new(model.ListRoleNamesResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListRoles() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/roles"). + WithResponse(new(model.ListRolesResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("RolePattern"). + WithJsonTag("role_pattern"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Marker"). + WithJsonTag("marker"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ReversePage"). + WithJsonTag("reverse_page"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForShowRole() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/roles/{role_name}"). + WithResponse(new(model.ShowRoleResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("RoleName"). + WithJsonTag("role_name"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForUpdateRole() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPut). + WithPath("/v1/{project_id}/instances/{instance_id}/roles/{role_name}"). + WithResponse(new(model.UpdateRoleResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("RoleName"). + WithJsonTag("role_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListSpecs() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/specs"). + WithResponse(new(model.ListSpecsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("SpecCode"). + WithJsonTag("spec_code"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Offset"). + WithJsonTag("offset"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForCreateTable() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables"). + WithResponse(new(model.CreateTableResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeleteAllTables() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/truncate"). + WithResponse(new(model.DeleteAllTablesResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeleteTable() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodDelete). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}"). + WithResponse(new(model.DeleteTableResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DeleteData"). + WithJsonTag("delete_data"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListTableMeta() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/tables"). + WithResponse(new(model.ListTableMetaResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseNamePattern"). + WithJsonTag("database_name_pattern"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableNamePattern"). + WithJsonTag("table_name_pattern"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableTypes"). + WithJsonTag("table_types"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Marker"). + WithJsonTag("marker"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ReversePage"). + WithJsonTag("reverse_page"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListTableNames() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/names"). + WithResponse(new(model.ListTableNamesResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TablePattern"). + WithJsonTag("table_pattern"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableType"). + WithJsonTag("table_type"). + WithLocationType(def.Query)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListTables() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables"). + WithResponse(new(model.ListTablesResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableNamePattern"). + WithJsonTag("table_name_pattern"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableType"). + WithJsonTag("table_type"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Filter"). + WithJsonTag("filter"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Marker"). + WithJsonTag("marker"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ReversePage"). + WithJsonTag("reverse_page"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListTablesByName() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/list-by-names"). + WithResponse(new(model.ListTablesByNameResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForShowTable() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}"). + WithResponse(new(model.ShowTableResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForUpdateTable() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPut). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}"). + WithResponse(new(model.UpdateTableResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeleteTableColumnStatistics() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodDelete). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/column-statistics"). + WithResponse(new(model.DeleteTableColumnStatisticsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ColumnName"). + WithJsonTag("column_name"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListTableColumnStatistics() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/column-statistics/batch-get"). + WithResponse(new(model.ListTableColumnStatisticsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForSetTableColumnStatistics() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/column-statistics"). + WithResponse(new(model.SetTableColumnStatisticsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForBatchCreateConstraint() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/constraints"). + WithResponse(new(model.BatchCreateConstraintResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeleteConstraint() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodDelete). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/constraints/{constraint_name}"). + WithResponse(new(model.DeleteConstraintResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ConstraintName"). + WithJsonTag("constraint_name"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListConstraints() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/constraints"). + WithResponse(new(model.ListConstraintsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CatalogName"). + WithJsonTag("catalog_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("DatabaseName"). + WithJsonTag("database_name"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("TableName"). + WithJsonTag("table_name"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Type"). + WithJsonTag("type"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ParentDb"). + WithJsonTag("parent_db"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ParentTbl"). + WithJsonTag("parent_tbl"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForBatchUpdateLakeFormationInstanceTags() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPut). + WithPath("/v1/{project_id}/instances/{instance_id}/tags"). + WithResponse(new(model.BatchUpdateLakeFormationInstanceTagsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListGroupsForDomain() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1/{project_id}/instances/{instance_id}/groups"). + WithResponse(new(model.ListGroupsForDomainResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("InstanceId"). + WithJsonTag("instance_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("GroupSource"). + WithJsonTag("group_source"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Limit"). + WithJsonTag("limit"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Marker"). + WithJsonTag("marker"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ReversePage"). + WithJsonTag("reverse_page"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_access_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_access_info.go new file mode 100644 index 00000000..326ba625 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_access_info.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 接入信息 +type AccessInfo struct { + + // 服务名称 + VpcepServiceName *string `json:"vpcep_service_name,omitempty"` + + // 分组独立域名 + Domain *string `json:"domain,omitempty"` +} + +func (o AccessInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AccessInfo struct{}" + } + + return strings.Join([]string{"AccessInfo", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_access_policy_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_access_policy_input.go new file mode 100644 index 00000000..6c056d0b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_access_policy_input.go @@ -0,0 +1,282 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// access policy input body +type AccessPolicyInput struct { + + // 主体信息 + PrincipalList []Principal `json:"principal_list"` + + Resource *ResourceInfo `json:"resource"` + + // 拒绝/允许 + Effect bool `json:"effect"` + + // 权限列表 + Permissions []AccessPolicyInputPermissions `json:"permissions"` + + // 可传递的权限列表 + GrantAblePermissions *[]AccessPolicyInputGrantAblePermissions `json:"grant_able_permissions,omitempty"` + + // 条件 + Conditions *string `json:"conditions,omitempty"` + + // 行过滤 + DataFilter *string `json:"data_filter,omitempty"` + + // 列掩码 + DataMask *string `json:"data_mask,omitempty"` +} + +func (o AccessPolicyInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AccessPolicyInput struct{}" + } + + return strings.Join([]string{"AccessPolicyInput", string(data)}, " ") +} + +type AccessPolicyInputPermissions struct { + value string +} + +type AccessPolicyInputPermissionsEnum struct { + ALL AccessPolicyInputPermissions + CREATE AccessPolicyInputPermissions + ALTER AccessPolicyInputPermissions + DROP AccessPolicyInputPermissions + DESCRIBE AccessPolicyInputPermissions + EXEC AccessPolicyInputPermissions + CREATE_DATABASE AccessPolicyInputPermissions + LIST_DATABASE AccessPolicyInputPermissions + CREATE_TABLE AccessPolicyInputPermissions + LIST_TABLE AccessPolicyInputPermissions + CREATE_FUNC AccessPolicyInputPermissions + LIST_FUNC AccessPolicyInputPermissions + REGISTER_MODEL AccessPolicyInputPermissions + LIST_MODEL AccessPolicyInputPermissions + INSERT AccessPolicyInputPermissions + UPDATE AccessPolicyInputPermissions + DELETE AccessPolicyInputPermissions + SELECT AccessPolicyInputPermissions + READ AccessPolicyInputPermissions + WRITE AccessPolicyInputPermissions + OPERATE AccessPolicyInputPermissions +} + +func GetAccessPolicyInputPermissionsEnum() AccessPolicyInputPermissionsEnum { + return AccessPolicyInputPermissionsEnum{ + ALL: AccessPolicyInputPermissions{ + value: "ALL", + }, + CREATE: AccessPolicyInputPermissions{ + value: "CREATE", + }, + ALTER: AccessPolicyInputPermissions{ + value: "ALTER", + }, + DROP: AccessPolicyInputPermissions{ + value: "DROP", + }, + DESCRIBE: AccessPolicyInputPermissions{ + value: "DESCRIBE", + }, + EXEC: AccessPolicyInputPermissions{ + value: "EXEC", + }, + CREATE_DATABASE: AccessPolicyInputPermissions{ + value: "CREATE_DATABASE", + }, + LIST_DATABASE: AccessPolicyInputPermissions{ + value: "LIST_DATABASE", + }, + CREATE_TABLE: AccessPolicyInputPermissions{ + value: "CREATE_TABLE", + }, + LIST_TABLE: AccessPolicyInputPermissions{ + value: "LIST_TABLE", + }, + CREATE_FUNC: AccessPolicyInputPermissions{ + value: "CREATE_FUNC", + }, + LIST_FUNC: AccessPolicyInputPermissions{ + value: "LIST_FUNC", + }, + REGISTER_MODEL: AccessPolicyInputPermissions{ + value: "REGISTER_MODEL", + }, + LIST_MODEL: AccessPolicyInputPermissions{ + value: "LIST_MODEL", + }, + INSERT: AccessPolicyInputPermissions{ + value: "INSERT", + }, + UPDATE: AccessPolicyInputPermissions{ + value: "UPDATE", + }, + DELETE: AccessPolicyInputPermissions{ + value: "DELETE", + }, + SELECT: AccessPolicyInputPermissions{ + value: "SELECT", + }, + READ: AccessPolicyInputPermissions{ + value: "READ", + }, + WRITE: AccessPolicyInputPermissions{ + value: "WRITE", + }, + OPERATE: AccessPolicyInputPermissions{ + value: "OPERATE", + }, + } +} + +func (c AccessPolicyInputPermissions) Value() string { + return c.value +} + +func (c AccessPolicyInputPermissions) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *AccessPolicyInputPermissions) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type AccessPolicyInputGrantAblePermissions struct { + value string +} + +type AccessPolicyInputGrantAblePermissionsEnum struct { + ALL AccessPolicyInputGrantAblePermissions + CREATE AccessPolicyInputGrantAblePermissions + ALTER AccessPolicyInputGrantAblePermissions + DROP AccessPolicyInputGrantAblePermissions + DESCRIBE AccessPolicyInputGrantAblePermissions + EXEC AccessPolicyInputGrantAblePermissions + CREATE_DATABASE AccessPolicyInputGrantAblePermissions + LIST_DATABASE AccessPolicyInputGrantAblePermissions + CREATE_TABLE AccessPolicyInputGrantAblePermissions + LIST_TABLE AccessPolicyInputGrantAblePermissions + CREATE_FUNC AccessPolicyInputGrantAblePermissions + LIST_FUNC AccessPolicyInputGrantAblePermissions + REGISTER_MODEL AccessPolicyInputGrantAblePermissions + LIST_MODEL AccessPolicyInputGrantAblePermissions + INSERT AccessPolicyInputGrantAblePermissions + UPDATE AccessPolicyInputGrantAblePermissions + DELETE AccessPolicyInputGrantAblePermissions + SELECT AccessPolicyInputGrantAblePermissions + READ AccessPolicyInputGrantAblePermissions + WRITE AccessPolicyInputGrantAblePermissions + OPERATE AccessPolicyInputGrantAblePermissions +} + +func GetAccessPolicyInputGrantAblePermissionsEnum() AccessPolicyInputGrantAblePermissionsEnum { + return AccessPolicyInputGrantAblePermissionsEnum{ + ALL: AccessPolicyInputGrantAblePermissions{ + value: "ALL", + }, + CREATE: AccessPolicyInputGrantAblePermissions{ + value: "CREATE", + }, + ALTER: AccessPolicyInputGrantAblePermissions{ + value: "ALTER", + }, + DROP: AccessPolicyInputGrantAblePermissions{ + value: "DROP", + }, + DESCRIBE: AccessPolicyInputGrantAblePermissions{ + value: "DESCRIBE", + }, + EXEC: AccessPolicyInputGrantAblePermissions{ + value: "EXEC", + }, + CREATE_DATABASE: AccessPolicyInputGrantAblePermissions{ + value: "CREATE_DATABASE", + }, + LIST_DATABASE: AccessPolicyInputGrantAblePermissions{ + value: "LIST_DATABASE", + }, + CREATE_TABLE: AccessPolicyInputGrantAblePermissions{ + value: "CREATE_TABLE", + }, + LIST_TABLE: AccessPolicyInputGrantAblePermissions{ + value: "LIST_TABLE", + }, + CREATE_FUNC: AccessPolicyInputGrantAblePermissions{ + value: "CREATE_FUNC", + }, + LIST_FUNC: AccessPolicyInputGrantAblePermissions{ + value: "LIST_FUNC", + }, + REGISTER_MODEL: AccessPolicyInputGrantAblePermissions{ + value: "REGISTER_MODEL", + }, + LIST_MODEL: AccessPolicyInputGrantAblePermissions{ + value: "LIST_MODEL", + }, + INSERT: AccessPolicyInputGrantAblePermissions{ + value: "INSERT", + }, + UPDATE: AccessPolicyInputGrantAblePermissions{ + value: "UPDATE", + }, + DELETE: AccessPolicyInputGrantAblePermissions{ + value: "DELETE", + }, + SELECT: AccessPolicyInputGrantAblePermissions{ + value: "SELECT", + }, + READ: AccessPolicyInputGrantAblePermissions{ + value: "READ", + }, + WRITE: AccessPolicyInputGrantAblePermissions{ + value: "WRITE", + }, + OPERATE: AccessPolicyInputGrantAblePermissions{ + value: "OPERATE", + }, + } +} + +func (c AccessPolicyInputGrantAblePermissions) Value() string { + return c.value +} + +func (c AccessPolicyInputGrantAblePermissions) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *AccessPolicyInputGrantAblePermissions) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_access_request_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_access_request_info.go new file mode 100644 index 00000000..5c4a1098 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_access_request_info.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 申请接入服务的请求信息 +type AccessRequestInfo struct { + + // 服务创建的id + VpcepId string `json:"vpcep_id"` + + // 分组独立域名 + Domain string `json:"domain"` +} + +func (o AccessRequestInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AccessRequestInfo struct{}" + } + + return strings.Join([]string{"AccessRequestInfo", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_add_partition_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_add_partition_input.go new file mode 100644 index 00000000..ad6d7a98 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_add_partition_input.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 添加分区信息 +type AddPartitionInput struct { + + // 是否跳过已存在的分区 + IfNotExist bool `json:"if_not_exist"` + + // 添加的分区信息 + Partitions []PartitionInput `json:"partitions"` +} + +func (o AddPartitionInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AddPartitionInput struct{}" + } + + return strings.Join([]string{"AddPartitionInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_add_partitions_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_add_partitions_request.go new file mode 100644 index 00000000..3b85915c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_add_partitions_request.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type AddPartitionsRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + Body *AddPartitionInput `json:"body,omitempty"` +} + +func (o AddPartitionsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AddPartitionsRequest struct{}" + } + + return strings.Join([]string{"AddPartitionsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_add_partitions_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_add_partitions_response.go new file mode 100644 index 00000000..5af0fee5 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_add_partitions_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type AddPartitionsResponse struct { + Body *[]Partition `json:"body,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o AddPartitionsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AddPartitionsResponse struct{}" + } + + return strings.Join([]string{"AddPartitionsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_agreement_rule.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_agreement_rule.go new file mode 100644 index 00000000..e201a34c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_agreement_rule.go @@ -0,0 +1,32 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 协议规则信息 +type AgreementRule struct { + + // 协议名称 + AgreementName *string `json:"agreement_name,omitempty"` + + // 协议展示名称 + AgreementDisplayName *string `json:"agreement_display_name,omitempty"` + + // 协议版本 + AgreementVersion *string `json:"agreement_version,omitempty"` + + // 协议链接 + AgreementUrl *string `json:"agreement_url,omitempty"` +} + +func (o AgreementRule) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AgreementRule struct{}" + } + + return strings.Join([]string{"AgreementRule", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_partition_entry.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_partition_entry.go new file mode 100644 index 00000000..434d742a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_partition_entry.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 修改分区实体 +type AlterPartitionEntry struct { + Partition *PartitionInput `json:"partition"` + + // 原分区值数组 + PartitionValues []string `json:"partition_values"` +} + +func (o AlterPartitionEntry) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AlterPartitionEntry struct{}" + } + + return strings.Join([]string{"AlterPartitionEntry", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_partitions_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_partitions_input.go new file mode 100644 index 00000000..518e14af --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_partitions_input.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 修改分区输入 +type AlterPartitionsInput struct { + + // 批量修改分区对象数组 + PartitionInputs []AlterPartitionEntry `json:"partition_inputs"` +} + +func (o AlterPartitionsInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AlterPartitionsInput struct{}" + } + + return strings.Join([]string{"AlterPartitionsInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_role_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_role_input.go new file mode 100644 index 00000000..a45699ad --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_role_input.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// role信息 +type AlterRoleInput struct { + + // 描述信息 + Description *string `json:"description,omitempty"` + + // 角色名称 + RoleName *string `json:"role_name,omitempty"` +} + +func (o AlterRoleInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AlterRoleInput struct{}" + } + + return strings.Join([]string{"AlterRoleInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_table_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_table_input.go new file mode 100644 index 00000000..56d990c6 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_alter_table_input.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type AlterTableInput struct { + + // 修改表参数映射信息,支持的参数如下: CASADE: 级联删除列,如果为true则会把partition中的列也删除;如果为false则不会 DO_NOT_UPDATE_STATS: 不更新文件级别统计信息。true则不更新;false则更新。 STATS_GENERATED:记录本次更新的发起者。可填:TASK/USET。具体作用未明确。 + AlterParams map[string]string `json:"alter_params,omitempty"` + + Table *TableInput `json:"table"` +} + +func (o AlterTableInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AlterTableInput struct{}" + } + + return strings.Join([]string{"AlterTableInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_apply_for_access_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_apply_for_access_request.go new file mode 100644 index 00000000..4dcf893a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_apply_for_access_request.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ApplyForAccessRequest struct { + + // LakeFormation实例ID + InstanceId string `json:"instance_id"` + + // 申请接入服务的请求信息 + Body *[]AccessRequestInfo `json:"body,omitempty"` +} + +func (o ApplyForAccessRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ApplyForAccessRequest struct{}" + } + + return strings.Join([]string{"ApplyForAccessRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_apply_for_access_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_apply_for_access_response.go new file mode 100644 index 00000000..fba419be --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_apply_for_access_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ApplyForAccessResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o ApplyForAccessResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ApplyForAccessResponse struct{}" + } + + return strings.Join([]string{"ApplyForAccessResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_authorize_interface_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_authorize_interface_request.go new file mode 100644 index 00000000..f7f58ddb --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_authorize_interface_request.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type BatchAuthorizeInterfaceRequest struct { + + // instance id + InstanceId string `json:"instance_id"` + + Body *AccessPolicyInput `json:"body,omitempty"` +} + +func (o BatchAuthorizeInterfaceRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchAuthorizeInterfaceRequest struct{}" + } + + return strings.Join([]string{"BatchAuthorizeInterfaceRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_authorize_interface_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_authorize_interface_response.go new file mode 100644 index 00000000..6c04a020 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_authorize_interface_response.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type BatchAuthorizeInterfaceResponse struct { + + // lakecat策略信息 + Policies *[]LakeFormationPolicy `json:"policies,omitempty"` + + PageInfo *PagedInfo `json:"page_info,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o BatchAuthorizeInterfaceResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchAuthorizeInterfaceResponse struct{}" + } + + return strings.Join([]string{"BatchAuthorizeInterfaceResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_cancel_authorization_interface_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_cancel_authorization_interface_request.go new file mode 100644 index 00000000..2878c630 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_cancel_authorization_interface_request.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type BatchCancelAuthorizationInterfaceRequest struct { + + // instance id + InstanceId string `json:"instance_id"` + + Body *AccessPolicyInput `json:"body,omitempty"` +} + +func (o BatchCancelAuthorizationInterfaceRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchCancelAuthorizationInterfaceRequest struct{}" + } + + return strings.Join([]string{"BatchCancelAuthorizationInterfaceRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_cancel_authorization_interface_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_cancel_authorization_interface_response.go new file mode 100644 index 00000000..45b4eb4a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_cancel_authorization_interface_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type BatchCancelAuthorizationInterfaceResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o BatchCancelAuthorizationInterfaceResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchCancelAuthorizationInterfaceResponse struct{}" + } + + return strings.Join([]string{"BatchCancelAuthorizationInterfaceResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_create_constraint_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_create_constraint_request.go new file mode 100644 index 00000000..56162084 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_create_constraint_request.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type BatchCreateConstraintRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + Body *TableConstraintsInput `json:"body,omitempty"` +} + +func (o BatchCreateConstraintRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchCreateConstraintRequest struct{}" + } + + return strings.Join([]string{"BatchCreateConstraintRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_create_constraint_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_create_constraint_response.go new file mode 100644 index 00000000..9803bae6 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_create_constraint_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type BatchCreateConstraintResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o BatchCreateConstraintResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchCreateConstraintResponse struct{}" + } + + return strings.Join([]string{"BatchCreateConstraintResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partition_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partition_request.go new file mode 100644 index 00000000..d664f98b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partition_request.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type BatchDeletePartitionRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + Body *DropPartitionsInput `json:"body,omitempty"` +} + +func (o BatchDeletePartitionRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchDeletePartitionRequest struct{}" + } + + return strings.Join([]string{"BatchDeletePartitionRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partition_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partition_response.go new file mode 100644 index 00000000..e596cf8f --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partition_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type BatchDeletePartitionResponse struct { + Body *[]Partition `json:"body,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o BatchDeletePartitionResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchDeletePartitionResponse struct{}" + } + + return strings.Join([]string{"BatchDeletePartitionResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partitioned_statistics_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partitioned_statistics_request.go new file mode 100644 index 00000000..e24773d2 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partitioned_statistics_request.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type BatchDeletePartitionedStatisticsRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + Body *TruncatePartitionInput `json:"body,omitempty"` +} + +func (o BatchDeletePartitionedStatisticsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchDeletePartitionedStatisticsRequest struct{}" + } + + return strings.Join([]string{"BatchDeletePartitionedStatisticsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partitioned_statistics_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partitioned_statistics_response.go new file mode 100644 index 00000000..819335ff --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_delete_partitioned_statistics_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type BatchDeletePartitionedStatisticsResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o BatchDeletePartitionedStatisticsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchDeletePartitionedStatisticsResponse struct{}" + } + + return strings.Join([]string{"BatchDeletePartitionedStatisticsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_list_partition_by_values_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_list_partition_by_values_request.go new file mode 100644 index 00000000..599df03c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_list_partition_by_values_request.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type BatchListPartitionByValuesRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + Body *GetPartitionsByValuesInput `json:"body,omitempty"` +} + +func (o BatchListPartitionByValuesRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchListPartitionByValuesRequest struct{}" + } + + return strings.Join([]string{"BatchListPartitionByValuesRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_list_partition_by_values_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_list_partition_by_values_response.go new file mode 100644 index 00000000..0f2073fc --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_list_partition_by_values_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type BatchListPartitionByValuesResponse struct { + Body *[]Partition `json:"body,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o BatchListPartitionByValuesResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchListPartitionByValuesResponse struct{}" + } + + return strings.Join([]string{"BatchListPartitionByValuesResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_show_partition_column_statistics_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_show_partition_column_statistics_request.go new file mode 100644 index 00000000..0773660e --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_show_partition_column_statistics_request.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type BatchShowPartitionColumnStatisticsRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + Body *GetPartitionColumnStatisticsInput `json:"body,omitempty"` +} + +func (o BatchShowPartitionColumnStatisticsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchShowPartitionColumnStatisticsRequest struct{}" + } + + return strings.Join([]string{"BatchShowPartitionColumnStatisticsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_show_partition_column_statistics_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_show_partition_column_statistics_response.go new file mode 100644 index 00000000..333d0a25 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_show_partition_column_statistics_response.go @@ -0,0 +1,27 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type BatchShowPartitionColumnStatisticsResponse struct { + + // 分区统计信息的数量 + FoundPartitionNumber *int32 `json:"found_partition_number,omitempty"` + + // 分区统计信息的列表 + ColumnStatistics map[string][]ColumnStatisticsObj `json:"column_statistics,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o BatchShowPartitionColumnStatisticsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchShowPartitionColumnStatisticsResponse struct{}" + } + + return strings.Join([]string{"BatchShowPartitionColumnStatisticsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_lake_formation_instance_tags_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_lake_formation_instance_tags_request.go new file mode 100644 index 00000000..ab516a6c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_lake_formation_instance_tags_request.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type BatchUpdateLakeFormationInstanceTagsRequest struct { + + // LakeFormation实例ID + InstanceId string `json:"instance_id"` + + Body *BatchUpdateTagsRequestBody `json:"body,omitempty"` +} + +func (o BatchUpdateLakeFormationInstanceTagsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchUpdateLakeFormationInstanceTagsRequest struct{}" + } + + return strings.Join([]string{"BatchUpdateLakeFormationInstanceTagsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_lake_formation_instance_tags_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_lake_formation_instance_tags_response.go new file mode 100644 index 00000000..de072b02 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_lake_formation_instance_tags_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type BatchUpdateLakeFormationInstanceTagsResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o BatchUpdateLakeFormationInstanceTagsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchUpdateLakeFormationInstanceTagsResponse struct{}" + } + + return strings.Join([]string{"BatchUpdateLakeFormationInstanceTagsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_partition_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_partition_request.go new file mode 100644 index 00000000..fdd56a0a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_partition_request.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type BatchUpdatePartitionRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + Body *AlterPartitionsInput `json:"body,omitempty"` +} + +func (o BatchUpdatePartitionRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchUpdatePartitionRequest struct{}" + } + + return strings.Join([]string{"BatchUpdatePartitionRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_partition_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_partition_response.go new file mode 100644 index 00000000..d21350dc --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_partition_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type BatchUpdatePartitionResponse struct { + Body *[]Partition `json:"body,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o BatchUpdatePartitionResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchUpdatePartitionResponse struct{}" + } + + return strings.Join([]string{"BatchUpdatePartitionResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_tags_request_body.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_tags_request_body.go new file mode 100644 index 00000000..80c8b997 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_batch_update_tags_request_body.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type BatchUpdateTagsRequestBody struct { + + // 标签列表 + Tags *[]ResourceTag `json:"tags,omitempty"` +} + +func (o BatchUpdateTagsRequestBody) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchUpdateTagsRequestBody struct{}" + } + + return strings.Join([]string{"BatchUpdateTagsRequestBody", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_binary_column_statistics_data.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_binary_column_statistics_data.go new file mode 100644 index 00000000..a5d6ae80 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_binary_column_statistics_data.go @@ -0,0 +1,28 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type BinaryColumnStatisticsData struct { + + // 列中字节数组的最大值 + MaximumLength int64 `json:"maximum_length"` + + // 列中字节数组的平均长度 + AverageLength float64 `json:"average_length"` + + // 列中空值个数 + NumberOfNull int64 `json:"number_of_null"` +} + +func (o BinaryColumnStatisticsData) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BinaryColumnStatisticsData struct{}" + } + + return strings.Join([]string{"BinaryColumnStatisticsData", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_boolean_column_statistics_data.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_boolean_column_statistics_data.go new file mode 100644 index 00000000..ba630f4a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_boolean_column_statistics_data.go @@ -0,0 +1,28 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type BooleanColumnStatisticsData struct { + + // 列中为真的数量 + NumberOfTrue int64 `json:"number_of_true"` + + // 列中为假的数量 + NumberOfFalse int64 `json:"number_of_false"` + + // 列中为空的数量 + NumberOfNull int64 `json:"number_of_null"` +} + +func (o BooleanColumnStatisticsData) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BooleanColumnStatisticsData struct{}" + } + + return strings.Join([]string{"BooleanColumnStatisticsData", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_bucket_detail.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_bucket_detail.go new file mode 100644 index 00000000..82f41523 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_bucket_detail.go @@ -0,0 +1,33 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// obs桶详细信息 +type BucketDetail struct { + + // obs桶id + Id string `json:"id"` + + // obs桶名 + Name string `json:"name"` + + // obs桶创建时间 + CreationDate *sdktime.SdkTime `json:"creation_date,omitempty"` + + // 所属region + Location string `json:"location"` +} + +func (o BucketDetail) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BucketDetail struct{}" + } + + return strings.Join([]string{"BucketDetail", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_catalog.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_catalog.go new file mode 100644 index 00000000..be7bb22b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_catalog.go @@ -0,0 +1,32 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// catalog response +type Catalog struct { + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 描述信息 + Description *string `json:"description,omitempty"` + + // 路径地址 + Location string `json:"location"` + + // database路径列表 + DatabaseLocationList *[]string `json:"database_location_list,omitempty"` +} + +func (o Catalog) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Catalog struct{}" + } + + return strings.Join([]string{"Catalog", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_catalog_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_catalog_info.go new file mode 100644 index 00000000..bc4b99a7 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_catalog_info.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// catalog input when grant policy +type CatalogInfo struct { + + // 子数据库信息 + Databases *[]DatabaseInfo `json:"databases,omitempty"` + + // catalog名 + Name string `json:"name"` +} + +func (o CatalogInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CatalogInfo struct{}" + } + + return strings.Join([]string{"CatalogInfo", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_catalog_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_catalog_input.go new file mode 100644 index 00000000..9ebdcf6d --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_catalog_input.go @@ -0,0 +1,32 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// catalog信息 +type CatalogInput struct { + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 描述信息 + Description *string `json:"description,omitempty"` + + // 路径地址 + Location string `json:"location"` + + // database路径列表 + DatabaseLocationList *[]string `json:"database_location_list,omitempty"` +} + +func (o CatalogInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CatalogInput struct{}" + } + + return strings.Join([]string{"CatalogInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_check_constraint.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_check_constraint.go new file mode 100644 index 00000000..b4df2a8f --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_check_constraint.go @@ -0,0 +1,46 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type CheckConstraint struct { + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + // 列名 + ColumnName string `json:"column_name"` + + // constraint Name + ConstraintName string `json:"constraint_name"` + + // 检查条件表达式 + CheckExpression *string `json:"check_expression,omitempty"` + + // enable constraint + EnableConstraint bool `json:"enable_constraint"` + + // constraint is rely when Query + RelyConstraint bool `json:"rely_constraint"` + + // constraint is validated + ValidateConstraint bool `json:"validate_constraint"` +} + +func (o CheckConstraint) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CheckConstraint struct{}" + } + + return strings.Join([]string{"CheckConstraint", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_check_constraint_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_check_constraint_input.go new file mode 100644 index 00000000..b7cbb4ac --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_check_constraint_input.go @@ -0,0 +1,37 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type CheckConstraintInput struct { + + // 列名 + ColumnName string `json:"column_name"` + + // constraint Name + ConstraintName string `json:"constraint_name"` + + // 检查条件表达式 + CheckExpression *string `json:"check_expression,omitempty"` + + // enable constraint + EnableConstraint bool `json:"enable_constraint"` + + // constraint is rely when Query + RelyConstraint bool `json:"rely_constraint"` + + // constraint is validated + ValidateConstraint bool `json:"validate_constraint"` +} + +func (o CheckConstraintInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CheckConstraintInput struct{}" + } + + return strings.Join([]string{"CheckConstraintInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_column.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_column.go new file mode 100644 index 00000000..2816ada0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_column.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 列信息 +type Column struct { + + // 列类型,包括array bigint binary boolean char date decimal double float int interval map set smallint string struct timestamp tinyint union varchar + ColumnType string `json:"column_type"` + + // 列名 + ColumnName string `json:"column_name"` + + // 列描述信息 + Comment *string `json:"comment,omitempty"` +} + +func (o Column) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Column struct{}" + } + + return strings.Join([]string{"Column", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_column_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_column_info.go new file mode 100644 index 00000000..e4dcda3a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_column_info.go @@ -0,0 +1,71 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// column input when grant policy +type ColumnInfo struct { + + // 列名 + ColumnName []string `json:"column_name"` + + // 是否排除:Include包含,Exclude排除 + Filter ColumnInfoFilter `json:"filter"` +} + +func (o ColumnInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ColumnInfo struct{}" + } + + return strings.Join([]string{"ColumnInfo", string(data)}, " ") +} + +type ColumnInfoFilter struct { + value string +} + +type ColumnInfoFilterEnum struct { + INCLUDE ColumnInfoFilter + EXCLUDE ColumnInfoFilter +} + +func GetColumnInfoFilterEnum() ColumnInfoFilterEnum { + return ColumnInfoFilterEnum{ + INCLUDE: ColumnInfoFilter{ + value: "Include", + }, + EXCLUDE: ColumnInfoFilter{ + value: "Exclude", + }, + } +} + +func (c ColumnInfoFilter) Value() string { + return c.value +} + +func (c ColumnInfoFilter) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ColumnInfoFilter) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_column_statistics_obj.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_column_statistics_obj.go new file mode 100644 index 00000000..0e9786e2 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_column_statistics_obj.go @@ -0,0 +1,107 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type ColumnStatisticsObj struct { + + // 数据列名 + ColumnName string `json:"column_name"` + + // 数据类型,字段类型包括array bigint binary boolean char date decimal double float int interval map set smallint string struct timestamp tinyint union varchar + ColumnType string `json:"column_type"` + + // 统计信息类型 + DataType ColumnStatisticsObjDataType `json:"data_type"` + + BinaryStatisticsData *BinaryColumnStatisticsData `json:"binary_statistics_data,omitempty"` + + LongStatisticsData *LongColumnStatisticsData `json:"long_statistics_data,omitempty"` + + DecimalStatisticsData *DecimalColumnStatisticsData `json:"decimal_statistics_data,omitempty"` + + StringStatisticsData *StringColumnStatisticsData `json:"string_statistics_data,omitempty"` + + DoubleStatisticsData *DoubleColumnStatisticsData `json:"double_statistics_data,omitempty"` + + DateStatisticsData *DateColumnStatisticsData `json:"date_statistics_data,omitempty"` + + BooleanStatisticsData *BooleanColumnStatisticsData `json:"boolean_statistics_data,omitempty"` +} + +func (o ColumnStatisticsObj) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ColumnStatisticsObj struct{}" + } + + return strings.Join([]string{"ColumnStatisticsObj", string(data)}, " ") +} + +type ColumnStatisticsObjDataType struct { + value string +} + +type ColumnStatisticsObjDataTypeEnum struct { + BINARY_STATS ColumnStatisticsObjDataType + BOOLEAN_STATS ColumnStatisticsObjDataType + DATE_STATS ColumnStatisticsObjDataType + DECIMAL_STATS ColumnStatisticsObjDataType + DOUBLE_STATS ColumnStatisticsObjDataType + LONG_STATS ColumnStatisticsObjDataType + STRING_STATS ColumnStatisticsObjDataType +} + +func GetColumnStatisticsObjDataTypeEnum() ColumnStatisticsObjDataTypeEnum { + return ColumnStatisticsObjDataTypeEnum{ + BINARY_STATS: ColumnStatisticsObjDataType{ + value: "binaryStats", + }, + BOOLEAN_STATS: ColumnStatisticsObjDataType{ + value: "booleanStats", + }, + DATE_STATS: ColumnStatisticsObjDataType{ + value: "dateStats", + }, + DECIMAL_STATS: ColumnStatisticsObjDataType{ + value: "decimalStats", + }, + DOUBLE_STATS: ColumnStatisticsObjDataType{ + value: "doubleStats", + }, + LONG_STATS: ColumnStatisticsObjDataType{ + value: "longStats", + }, + STRING_STATS: ColumnStatisticsObjDataType{ + value: "stringStats", + }, + } +} + +func (c ColumnStatisticsObjDataType) Value() string { + return c.value +} + +func (c ColumnStatisticsObjDataType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ColumnStatisticsObjDataType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_count_meta_obj_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_count_meta_obj_request.go new file mode 100644 index 00000000..b89e9eda --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_count_meta_obj_request.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type CountMetaObjRequest struct { + + // instance id + InstanceId string `json:"instance_id"` +} + +func (o CountMetaObjRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CountMetaObjRequest struct{}" + } + + return strings.Join([]string{"CountMetaObjRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_count_meta_obj_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_count_meta_obj_response.go new file mode 100644 index 00000000..6a1b03f9 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_count_meta_obj_response.go @@ -0,0 +1,42 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type CountMetaObjResponse struct { + + // 总数量 + TotalCount *int64 `json:"total_count,omitempty"` + + // 函数数量 + FunctionsCount *int64 `json:"functions_count,omitempty"` + + // 目录数量 + CatalogsCount *int64 `json:"catalogs_count,omitempty"` + + // 数据库数量 + DatabasesCount *int64 `json:"databases_count,omitempty"` + + // 表数量 + TablesCount *int64 `json:"tables_count,omitempty"` + + // 分区数量 + PartitionsCount *int64 `json:"partitions_count,omitempty"` + + // 索引数量 + IndexesCount *int64 `json:"indexes_count,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o CountMetaObjResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CountMetaObjResponse struct{}" + } + + return strings.Join([]string{"CountMetaObjResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_agreement_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_agreement_request.go new file mode 100644 index 00000000..a261a43f --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_agreement_request.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type CreateAgreementRequest struct { + Body *TenantAgreementBody `json:"body,omitempty"` +} + +func (o CreateAgreementRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateAgreementRequest struct{}" + } + + return strings.Join([]string{"CreateAgreementRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_agreement_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_agreement_response.go new file mode 100644 index 00000000..23762504 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_agreement_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type CreateAgreementResponse struct { + XRequestId *string `json:"X-request-id,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o CreateAgreementResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateAgreementResponse struct{}" + } + + return strings.Join([]string{"CreateAgreementResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_catalog_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_catalog_request.go new file mode 100644 index 00000000..8933b4c1 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_catalog_request.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type CreateCatalogRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + Body *CatalogInput `json:"body,omitempty"` +} + +func (o CreateCatalogRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateCatalogRequest struct{}" + } + + return strings.Join([]string{"CreateCatalogRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_catalog_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_catalog_response.go new file mode 100644 index 00000000..60c33efc --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_catalog_response.go @@ -0,0 +1,33 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type CreateCatalogResponse struct { + + // catalog名字 + CatalogName *string `json:"catalog_name,omitempty"` + + // 描述信息 + Description *string `json:"description,omitempty"` + + // 路径地址 + Location *string `json:"location,omitempty"` + + // database路径列表 + DatabaseLocationList *[]string `json:"database_location_list,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o CreateCatalogResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateCatalogResponse struct{}" + } + + return strings.Join([]string{"CreateCatalogResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_database_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_database_request.go new file mode 100644 index 00000000..84ede9a2 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_database_request.go @@ -0,0 +1,28 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type CreateDatabaseRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + Body *DatabaseInput `json:"body,omitempty"` +} + +func (o CreateDatabaseRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateDatabaseRequest struct{}" + } + + return strings.Join([]string{"CreateDatabaseRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_database_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_database_response.go new file mode 100644 index 00000000..957d4285 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_database_response.go @@ -0,0 +1,97 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// Response Object +type CreateDatabaseResponse struct { + + // catalog名字 + CatalogName *string `json:"catalog_name,omitempty"` + + // 数据库名 + DatabaseName *string `json:"database_name,omitempty"` + + // 数据库所有者 + Owner *string `json:"owner,omitempty"` + + // 所有者类型 + OwnerType *CreateDatabaseResponseOwnerType `json:"owner_type,omitempty"` + + // 数据库描述信息 + Description *string `json:"description,omitempty"` + + // 数据库路径地址 + Location *string `json:"location,omitempty"` + + // 参数信息 + Parameters map[string]string `json:"parameters,omitempty"` + + // 表路径列表 + TableLocationList *[]string `json:"table_location_list,omitempty"` + + // 函数路径列表 + FunctionLocationList *[]string `json:"function_location_list,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o CreateDatabaseResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateDatabaseResponse struct{}" + } + + return strings.Join([]string{"CreateDatabaseResponse", string(data)}, " ") +} + +type CreateDatabaseResponseOwnerType struct { + value string +} + +type CreateDatabaseResponseOwnerTypeEnum struct { + USER CreateDatabaseResponseOwnerType + GROUP CreateDatabaseResponseOwnerType + ROLE CreateDatabaseResponseOwnerType +} + +func GetCreateDatabaseResponseOwnerTypeEnum() CreateDatabaseResponseOwnerTypeEnum { + return CreateDatabaseResponseOwnerTypeEnum{ + USER: CreateDatabaseResponseOwnerType{ + value: "USER", + }, + GROUP: CreateDatabaseResponseOwnerType{ + value: "GROUP", + }, + ROLE: CreateDatabaseResponseOwnerType{ + value: "ROLE", + }, + } +} + +func (c CreateDatabaseResponseOwnerType) Value() string { + return c.value +} + +func (c CreateDatabaseResponseOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateDatabaseResponseOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_function_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_function_request.go new file mode 100644 index 00000000..c99c5746 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_function_request.go @@ -0,0 +1,31 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type CreateFunctionRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + Body *FunctionInput `json:"body,omitempty"` +} + +func (o CreateFunctionRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateFunctionRequest struct{}" + } + + return strings.Join([]string{"CreateFunctionRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_function_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_function_response.go new file mode 100644 index 00000000..022b8575 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_function_response.go @@ -0,0 +1,134 @@ +package model + +import ( + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + "strings" +) + +// Response Object +type CreateFunctionResponse struct { + + // catalog名字 + CatalogName *string `json:"catalog_name,omitempty"` + + // 数据库名字 + DatabaseName *string `json:"database_name,omitempty"` + + // 函数名 + FunctionName *string `json:"function_name,omitempty"` + + // 函数类型 + FunctionType *CreateFunctionResponseFunctionType `json:"function_type,omitempty"` + + // 函数所有者 + Owner *string `json:"owner,omitempty"` + + // 所有者类型 + OwnerType *CreateFunctionResponseOwnerType `json:"owner_type,omitempty"` + + // 函数类名 + ClassName *string `json:"class_name,omitempty"` + + // 创建时间格式为yyyy-mm-ddThh:mm:sss + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 函数地址信息 + ResourceUris *[]FunctionResourceUri `json:"resource_uris,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o CreateFunctionResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateFunctionResponse struct{}" + } + + return strings.Join([]string{"CreateFunctionResponse", string(data)}, " ") +} + +type CreateFunctionResponseFunctionType struct { + value string +} + +type CreateFunctionResponseFunctionTypeEnum struct { + JAVA CreateFunctionResponseFunctionType +} + +func GetCreateFunctionResponseFunctionTypeEnum() CreateFunctionResponseFunctionTypeEnum { + return CreateFunctionResponseFunctionTypeEnum{ + JAVA: CreateFunctionResponseFunctionType{ + value: "JAVA", + }, + } +} + +func (c CreateFunctionResponseFunctionType) Value() string { + return c.value +} + +func (c CreateFunctionResponseFunctionType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateFunctionResponseFunctionType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type CreateFunctionResponseOwnerType struct { + value string +} + +type CreateFunctionResponseOwnerTypeEnum struct { + USER CreateFunctionResponseOwnerType + GROUP CreateFunctionResponseOwnerType + ROLE CreateFunctionResponseOwnerType +} + +func GetCreateFunctionResponseOwnerTypeEnum() CreateFunctionResponseOwnerTypeEnum { + return CreateFunctionResponseOwnerTypeEnum{ + USER: CreateFunctionResponseOwnerType{ + value: "USER", + }, + GROUP: CreateFunctionResponseOwnerType{ + value: "GROUP", + }, + ROLE: CreateFunctionResponseOwnerType{ + value: "ROLE", + }, + } +} + +func (c CreateFunctionResponseOwnerType) Value() string { + return c.value +} + +func (c CreateFunctionResponseOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateFunctionResponseOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_instance_request_body.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_instance_request_body.go new file mode 100644 index 00000000..f6e485ed --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_instance_request_body.go @@ -0,0 +1,82 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// 创建LakeFormation实例请求体 +type CreateInstanceRequestBody struct { + + // 实例名 + Name string `json:"name"` + + // 支付类型,postPaid为按需期 + ChargeMode CreateInstanceRequestBodyChargeMode `json:"charge_mode"` + + // 企业项目id,只有对接了企业项目才可以填写 + EnterpriseProjectId *string `json:"enterprise_project_id,omitempty"` + + // 描述 + Description *string `json:"description,omitempty"` + + // false:物理多租 true:逻辑多租 + Shared bool `json:"shared"` + + // 规格列表 + Specs []CreateSpec `json:"specs"` + + // 标签列表 + Tags *[]ResourceTag `json:"tags,omitempty"` +} + +func (o CreateInstanceRequestBody) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateInstanceRequestBody struct{}" + } + + return strings.Join([]string{"CreateInstanceRequestBody", string(data)}, " ") +} + +type CreateInstanceRequestBodyChargeMode struct { + value string +} + +type CreateInstanceRequestBodyChargeModeEnum struct { + POST_PAID CreateInstanceRequestBodyChargeMode +} + +func GetCreateInstanceRequestBodyChargeModeEnum() CreateInstanceRequestBodyChargeModeEnum { + return CreateInstanceRequestBodyChargeModeEnum{ + POST_PAID: CreateInstanceRequestBodyChargeMode{ + value: "postPaid", + }, + } +} + +func (c CreateInstanceRequestBodyChargeMode) Value() string { + return c.value +} + +func (c CreateInstanceRequestBodyChargeMode) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateInstanceRequestBodyChargeMode) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_lake_formation_instance_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_lake_formation_instance_request.go new file mode 100644 index 00000000..f98b98ff --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_lake_formation_instance_request.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type CreateLakeFormationInstanceRequest struct { + Body *CreateInstanceRequestBody `json:"body,omitempty"` +} + +func (o CreateLakeFormationInstanceRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateLakeFormationInstanceRequest struct{}" + } + + return strings.Join([]string{"CreateLakeFormationInstanceRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_lake_formation_instance_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_lake_formation_instance_response.go new file mode 100644 index 00000000..b525bfc2 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_lake_formation_instance_response.go @@ -0,0 +1,57 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type CreateLakeFormationInstanceResponse struct { + + // LakeFormation实例Id + InstanceId *string `json:"instance_id,omitempty"` + + // 实例名 + Name *string `json:"name,omitempty"` + + // 描述 + Description *string `json:"description,omitempty"` + + // 企业项目Id + EnterpriseProjectId *string `json:"enterprise_project_id,omitempty"` + + // 逻辑多租和物理多租的判断 + Shared *bool `json:"shared,omitempty"` + + // 实例创建时间戳 + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 实例更新时间戳 + UpdateTime *sdktime.SdkTime `json:"update_time,omitempty"` + + // 实例状态 + Status *string `json:"status,omitempty"` + + // 是否在回收站 + InRecycleBin *bool `json:"in_recycle_bin,omitempty"` + + // 标签列表 + Tags *[]ResourceTag `json:"tags,omitempty"` + + // 规格信息 + Specs *[]CreateSpec `json:"specs,omitempty"` + + XRequestId *string `json:"X-request-id,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o CreateLakeFormationInstanceResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateLakeFormationInstanceResponse struct{}" + } + + return strings.Join([]string{"CreateLakeFormationInstanceResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_role_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_role_request.go new file mode 100644 index 00000000..d6bd451e --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_role_request.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type CreateRoleRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + Body *RoleInput `json:"body,omitempty"` +} + +func (o CreateRoleRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateRoleRequest struct{}" + } + + return strings.Join([]string{"CreateRoleRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_role_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_role_response.go new file mode 100644 index 00000000..03a3dd29 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_role_response.go @@ -0,0 +1,87 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// Response Object +type CreateRoleResponse struct { + + // role名字 + RoleName *string `json:"role_name,omitempty"` + + // 描述信息 + Description *string `json:"description,omitempty"` + + // 主体来源 IAM云用户 SAML联邦 LDAP ld用户 LOCAL 本地用户 OTHER 其它 + PrincipalSource *CreateRoleResponsePrincipalSource `json:"principal_source,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o CreateRoleResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateRoleResponse struct{}" + } + + return strings.Join([]string{"CreateRoleResponse", string(data)}, " ") +} + +type CreateRoleResponsePrincipalSource struct { + value string +} + +type CreateRoleResponsePrincipalSourceEnum struct { + IAM CreateRoleResponsePrincipalSource + SAML CreateRoleResponsePrincipalSource + LDAP CreateRoleResponsePrincipalSource + LOCAL CreateRoleResponsePrincipalSource + OTHER CreateRoleResponsePrincipalSource +} + +func GetCreateRoleResponsePrincipalSourceEnum() CreateRoleResponsePrincipalSourceEnum { + return CreateRoleResponsePrincipalSourceEnum{ + IAM: CreateRoleResponsePrincipalSource{ + value: "IAM", + }, + SAML: CreateRoleResponsePrincipalSource{ + value: "SAML", + }, + LDAP: CreateRoleResponsePrincipalSource{ + value: "LDAP", + }, + LOCAL: CreateRoleResponsePrincipalSource{ + value: "LOCAL", + }, + OTHER: CreateRoleResponsePrincipalSource{ + value: "OTHER", + }, + } +} + +func (c CreateRoleResponsePrincipalSource) Value() string { + return c.value +} + +func (c CreateRoleResponsePrincipalSource) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateRoleResponsePrincipalSource) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_spec.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_spec.go new file mode 100644 index 00000000..c279bada --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_spec.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type CreateSpec struct { + + // 规格编码 + SpecCode string `json:"spec_code"` + + // 步数 + StrideNum int32 `json:"stride_num"` +} + +func (o CreateSpec) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateSpec struct{}" + } + + return strings.Join([]string{"CreateSpec", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_table_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_table_request.go new file mode 100644 index 00000000..262596b8 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_table_request.go @@ -0,0 +1,31 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type CreateTableRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + Body *TableInput `json:"body,omitempty"` +} + +func (o CreateTableRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateTableRequest struct{}" + } + + return strings.Join([]string{"CreateTableRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_table_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_table_response.go new file mode 100644 index 00000000..04cc7e43 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_create_table_response.go @@ -0,0 +1,169 @@ +package model + +import ( + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + "strings" +) + +// Response Object +type CreateTableResponse struct { + + // catalog名字 + CatalogName *string `json:"catalog_name,omitempty"` + + // 数据库名字 + DatabaseName *string `json:"database_name,omitempty"` + + // 表名字 + TableName *string `json:"table_name,omitempty"` + + // 表创建时间 + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 最后访问时间 + LastAccessTime *sdktime.SdkTime `json:"last_access_time,omitempty"` + + // 表元数据最后一次修改时间 + UpdateTime *sdktime.SdkTime `json:"update_time,omitempty"` + + // 上一次做列级别的统计信息计算的时间 + LastAnalyzedTime *sdktime.SdkTime `json:"last_analyzed_time,omitempty"` + + // 用户信息 + Owner *string `json:"owner,omitempty"` + + // 用户类型 + OwnerType *CreateTableResponseOwnerType `json:"owner_type,omitempty"` + + // 参数 + Parameters map[string]string `json:"parameters,omitempty"` + + // 表分区列的列表 + PartitionKeys *[]Column `json:"partition_keys,omitempty"` + + // 表保留时间 + Retention *int32 `json:"retention,omitempty"` + + StorageDescriptor *StorageDescriptor `json:"storage_descriptor,omitempty"` + + // 表类型 + TableType *CreateTableResponseTableType `json:"table_type,omitempty"` + + // 表描述信息 + Comments *string `json:"comments,omitempty"` + + // 如果表是视图,则为视图的扩展文本;否则为 null + ViewExpandedText *string `json:"view_expanded_text,omitempty"` + + // 如果表是视图,则为视图的原始文本;否则为 null + ViewOriginalText *string `json:"view_original_text,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o CreateTableResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateTableResponse struct{}" + } + + return strings.Join([]string{"CreateTableResponse", string(data)}, " ") +} + +type CreateTableResponseOwnerType struct { + value string +} + +type CreateTableResponseOwnerTypeEnum struct { + USER CreateTableResponseOwnerType + GROUP CreateTableResponseOwnerType + ROLE CreateTableResponseOwnerType +} + +func GetCreateTableResponseOwnerTypeEnum() CreateTableResponseOwnerTypeEnum { + return CreateTableResponseOwnerTypeEnum{ + USER: CreateTableResponseOwnerType{ + value: "USER", + }, + GROUP: CreateTableResponseOwnerType{ + value: "GROUP", + }, + ROLE: CreateTableResponseOwnerType{ + value: "ROLE", + }, + } +} + +func (c CreateTableResponseOwnerType) Value() string { + return c.value +} + +func (c CreateTableResponseOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateTableResponseOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type CreateTableResponseTableType struct { + value string +} + +type CreateTableResponseTableTypeEnum struct { + MANAGED_TABLE CreateTableResponseTableType + EXTERNAL_TABLE CreateTableResponseTableType + VIRTUAL_VIEW CreateTableResponseTableType + MATERIALIZED_VIEW CreateTableResponseTableType +} + +func GetCreateTableResponseTableTypeEnum() CreateTableResponseTableTypeEnum { + return CreateTableResponseTableTypeEnum{ + MANAGED_TABLE: CreateTableResponseTableType{ + value: "MANAGED_TABLE", + }, + EXTERNAL_TABLE: CreateTableResponseTableType{ + value: "EXTERNAL_TABLE", + }, + VIRTUAL_VIEW: CreateTableResponseTableType{ + value: "VIRTUAL_VIEW", + }, + MATERIALIZED_VIEW: CreateTableResponseTableType{ + value: "MATERIALIZED_VIEW", + }, + } +} + +func (c CreateTableResponseTableType) Value() string { + return c.value +} + +func (c CreateTableResponseTableType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateTableResponseTableType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_data_mask_policy_item.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_data_mask_policy_item.go new file mode 100644 index 00000000..1ce5f96c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_data_mask_policy_item.go @@ -0,0 +1,39 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type DataMaskPolicyItem struct { + + // 访问数组 + Accesses *[]PolicyItemAccess `json:"accesses,omitempty"` + + // 条件数组 + Conditions *[]PolicyItemCondition `json:"conditions,omitempty"` + + DataMaskInfo *PolicyItemDataMaskInfo `json:"data_mask_info,omitempty"` + + // 是否支持传递 + DelegateAdmin *bool `json:"delegate_admin,omitempty"` + + // 用户组 + Groups *[]string `json:"groups,omitempty"` + + // 角色 + Roles *[]string `json:"roles,omitempty"` + + // 用户 + Users *[]string `json:"users,omitempty"` +} + +func (o DataMaskPolicyItem) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DataMaskPolicyItem struct{}" + } + + return strings.Join([]string{"DataMaskPolicyItem", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_database.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_database.go new file mode 100644 index 00000000..96b589d8 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_database.go @@ -0,0 +1,96 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// database +type Database struct { + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名 + DatabaseName string `json:"database_name"` + + // 数据库所有者 + Owner string `json:"owner"` + + // 所有者类型 + OwnerType DatabaseOwnerType `json:"owner_type"` + + // 数据库描述信息 + Description string `json:"description"` + + // 数据库路径地址 + Location string `json:"location"` + + // 参数信息 + Parameters map[string]string `json:"parameters"` + + // 表路径列表 + TableLocationList *[]string `json:"table_location_list,omitempty"` + + // 函数路径列表 + FunctionLocationList *[]string `json:"function_location_list,omitempty"` +} + +func (o Database) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Database struct{}" + } + + return strings.Join([]string{"Database", string(data)}, " ") +} + +type DatabaseOwnerType struct { + value string +} + +type DatabaseOwnerTypeEnum struct { + USER DatabaseOwnerType + GROUP DatabaseOwnerType + ROLE DatabaseOwnerType +} + +func GetDatabaseOwnerTypeEnum() DatabaseOwnerTypeEnum { + return DatabaseOwnerTypeEnum{ + USER: DatabaseOwnerType{ + value: "USER", + }, + GROUP: DatabaseOwnerType{ + value: "GROUP", + }, + ROLE: DatabaseOwnerType{ + value: "ROLE", + }, + } +} + +func (c DatabaseOwnerType) Value() string { + return c.value +} + +func (c DatabaseOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *DatabaseOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_database_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_database_info.go new file mode 100644 index 00000000..06a2c87b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_database_info.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// database input when grant policy +type DatabaseInfo struct { + + // 数据库名 + Name string `json:"name"` + + // 子表信息 + Tables *[]TableInfo `json:"tables,omitempty"` + + // 子方法信息 + Functions *[]FunctionInfo `json:"functions,omitempty"` +} + +func (o DatabaseInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DatabaseInfo struct{}" + } + + return strings.Join([]string{"DatabaseInfo", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_database_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_database_input.go new file mode 100644 index 00000000..188a4e6b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_database_input.go @@ -0,0 +1,93 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// 数据库信息 +type DatabaseInput struct { + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 数据库所有者 + Owner *string `json:"owner,omitempty"` + + // 所有者类型 + OwnerType *DatabaseInputOwnerType `json:"owner_type,omitempty"` + + // 数据库描述信息 + Description *string `json:"description,omitempty"` + + // 数据库位置 + Location *string `json:"location,omitempty"` + + // 标签信息 + Parameters map[string]string `json:"parameters,omitempty"` + + // 表路径列表 + TableLocationList *[]string `json:"table_location_list,omitempty"` + + // 函数路径列表 + FunctionLocationList *[]string `json:"function_location_list,omitempty"` +} + +func (o DatabaseInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DatabaseInput struct{}" + } + + return strings.Join([]string{"DatabaseInput", string(data)}, " ") +} + +type DatabaseInputOwnerType struct { + value string +} + +type DatabaseInputOwnerTypeEnum struct { + USER DatabaseInputOwnerType + ROLE DatabaseInputOwnerType + GROUP DatabaseInputOwnerType +} + +func GetDatabaseInputOwnerTypeEnum() DatabaseInputOwnerTypeEnum { + return DatabaseInputOwnerTypeEnum{ + USER: DatabaseInputOwnerType{ + value: "USER", + }, + ROLE: DatabaseInputOwnerType{ + value: "ROLE", + }, + GROUP: DatabaseInputOwnerType{ + value: "GROUP", + }, + } +} + +func (c DatabaseInputOwnerType) Value() string { + return c.value +} + +func (c DatabaseInputOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *DatabaseInputOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_date_column_statistics_data.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_date_column_statistics_data.go new file mode 100644 index 00000000..b804e62d --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_date_column_statistics_data.go @@ -0,0 +1,35 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type DateColumnStatisticsData struct { + + // 列中的最小时间戳 + MinimumValue *sdktime.SdkTime `json:"minimum_value,omitempty"` + + // 列中的最大时间戳 + MaximumValue *sdktime.SdkTime `json:"maximum_value,omitempty"` + + // 列中空值个数 + NumberOfNull int64 `json:"number_of_null"` + + // 列中去重后的时间戳个数 + NumberOfDistinctValue int64 `json:"number_of_distinct_value"` + + // 估算唯一值使用的位图 + BitVector string `json:"bit_vector,omitempty"` +} + +func (o DateColumnStatisticsData) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DateColumnStatisticsData struct{}" + } + + return strings.Join([]string{"DateColumnStatisticsData", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_decimal.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_decimal.go new file mode 100644 index 00000000..c5fa0320 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_decimal.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type Decimal struct { + + // 整数部分 + Scale *int32 `json:"scale,omitempty"` + + // 小数部分 + Unscaled string `json:"unscaled,omitempty"` +} + +func (o Decimal) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Decimal struct{}" + } + + return strings.Join([]string{"Decimal", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_decimal_column_statistics_data.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_decimal_column_statistics_data.go new file mode 100644 index 00000000..44c547c7 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_decimal_column_statistics_data.go @@ -0,0 +1,32 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 小数统计信息 +type DecimalColumnStatisticsData struct { + MinimumValue *Decimal `json:"minimum_value"` + + MaximumValue *Decimal `json:"maximum_value"` + + // 列中空值个数 + NumberOfNull int64 `json:"number_of_null"` + + // 列中去重后的小数个数 + NumberOfDistinctValue int64 `json:"number_of_distinct_value"` + + // 估算唯一值使用的位图 + BitVector string `json:"bit_vector,omitempty"` +} + +func (o DecimalColumnStatisticsData) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DecimalColumnStatisticsData struct{}" + } + + return strings.Join([]string{"DecimalColumnStatisticsData", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_default_constraint.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_default_constraint.go new file mode 100644 index 00000000..739c9d4e --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_default_constraint.go @@ -0,0 +1,46 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type DefaultConstraint struct { + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + // 列名 + ColumnName string `json:"column_name"` + + // constraint Name + ConstraintName string `json:"constraint_name"` + + // 默认值 + DefaultValue *string `json:"default_value,omitempty"` + + // enable constraint + EnableConstraint bool `json:"enable_constraint"` + + // constraint is rely when Query + RelyConstraint bool `json:"rely_constraint"` + + // constraint is validated + ValidateConstraint bool `json:"validate_constraint"` +} + +func (o DefaultConstraint) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DefaultConstraint struct{}" + } + + return strings.Join([]string{"DefaultConstraint", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_default_constraint_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_default_constraint_input.go new file mode 100644 index 00000000..351d3e68 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_default_constraint_input.go @@ -0,0 +1,37 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type DefaultConstraintInput struct { + + // 列名 + ColumnName string `json:"column_name"` + + // constraint Name + ConstraintName string `json:"constraint_name"` + + // 默认值 + DefaultValue *string `json:"default_value,omitempty"` + + // enable constraint + EnableConstraint bool `json:"enable_constraint"` + + // constraint is rely when Query + RelyConstraint bool `json:"rely_constraint"` + + // constraint is validated + ValidateConstraint bool `json:"validate_constraint"` +} + +func (o DefaultConstraintInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DefaultConstraintInput struct{}" + } + + return strings.Join([]string{"DefaultConstraintInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_all_tables_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_all_tables_request.go new file mode 100644 index 00000000..f078dc36 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_all_tables_request.go @@ -0,0 +1,32 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeleteAllTablesRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` +} + +func (o DeleteAllTablesRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteAllTablesRequest struct{}" + } + + return strings.Join([]string{"DeleteAllTablesRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_all_tables_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_all_tables_response.go new file mode 100644 index 00000000..e0e78a4e --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_all_tables_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeleteAllTablesResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o DeleteAllTablesResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteAllTablesResponse struct{}" + } + + return strings.Join([]string{"DeleteAllTablesResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_catalog_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_catalog_request.go new file mode 100644 index 00000000..05844e7e --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_catalog_request.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeleteCatalogRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` +} + +func (o DeleteCatalogRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteCatalogRequest struct{}" + } + + return strings.Join([]string{"DeleteCatalogRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_catalog_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_catalog_response.go new file mode 100644 index 00000000..ead63111 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_catalog_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeleteCatalogResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o DeleteCatalogResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteCatalogResponse struct{}" + } + + return strings.Join([]string{"DeleteCatalogResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_constraint_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_constraint_request.go new file mode 100644 index 00000000..a901e07e --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_constraint_request.go @@ -0,0 +1,35 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeleteConstraintRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + // 列限制信息名字; 外键填写外键限制名 + ConstraintName string `json:"constraint_name"` +} + +func (o DeleteConstraintRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteConstraintRequest struct{}" + } + + return strings.Join([]string{"DeleteConstraintRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_constraint_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_constraint_response.go new file mode 100644 index 00000000..816e8be6 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_constraint_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeleteConstraintResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o DeleteConstraintResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteConstraintResponse struct{}" + } + + return strings.Join([]string{"DeleteConstraintResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_database_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_database_request.go new file mode 100644 index 00000000..087b7f86 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_database_request.go @@ -0,0 +1,35 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeleteDatabaseRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名 + DatabaseName string `json:"database_name"` + + // 是否删除数据库路径下的数据 + DeleteData *bool `json:"delete_data,omitempty"` + + // 是否级联删除数据库下的表、分区以及函数 + Cascade *bool `json:"cascade,omitempty"` +} + +func (o DeleteDatabaseRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteDatabaseRequest struct{}" + } + + return strings.Join([]string{"DeleteDatabaseRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_database_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_database_response.go new file mode 100644 index 00000000..adc21a7a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_database_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeleteDatabaseResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o DeleteDatabaseResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteDatabaseResponse struct{}" + } + + return strings.Join([]string{"DeleteDatabaseResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_function_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_function_request.go new file mode 100644 index 00000000..3105c95c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_function_request.go @@ -0,0 +1,32 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeleteFunctionRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 函数名字 + FunctionName string `json:"function_name"` +} + +func (o DeleteFunctionRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteFunctionRequest struct{}" + } + + return strings.Join([]string{"DeleteFunctionRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_function_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_function_response.go new file mode 100644 index 00000000..620ca19e --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_function_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeleteFunctionResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o DeleteFunctionResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteFunctionResponse struct{}" + } + + return strings.Join([]string{"DeleteFunctionResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_lake_formation_instance_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_lake_formation_instance_request.go new file mode 100644 index 00000000..0b575980 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_lake_formation_instance_request.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeleteLakeFormationInstanceRequest struct { + + // 是否放入回收站 + ToRecycleBin bool `json:"to_recycle_bin"` + + // LakeFormation实例ID + InstanceId string `json:"instance_id"` +} + +func (o DeleteLakeFormationInstanceRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteLakeFormationInstanceRequest struct{}" + } + + return strings.Join([]string{"DeleteLakeFormationInstanceRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_lake_formation_instance_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_lake_formation_instance_response.go new file mode 100644 index 00000000..2db9a1b2 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_lake_formation_instance_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeleteLakeFormationInstanceResponse struct { + XRequestId *string `json:"X-request-id,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o DeleteLakeFormationInstanceResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteLakeFormationInstanceResponse struct{}" + } + + return strings.Join([]string{"DeleteLakeFormationInstanceResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_partition_column_statistics_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_partition_column_statistics_request.go new file mode 100644 index 00000000..0935fa34 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_partition_column_statistics_request.go @@ -0,0 +1,38 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeletePartitionColumnStatisticsRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + // 分区的值列表 + PartitionValues []string `json:"partition_values"` + + // 列名 + ColumnName *string `json:"column_name,omitempty"` +} + +func (o DeletePartitionColumnStatisticsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeletePartitionColumnStatisticsRequest struct{}" + } + + return strings.Join([]string{"DeletePartitionColumnStatisticsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_partition_column_statistics_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_partition_column_statistics_response.go new file mode 100644 index 00000000..83da5689 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_partition_column_statistics_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeletePartitionColumnStatisticsResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o DeletePartitionColumnStatisticsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeletePartitionColumnStatisticsResponse struct{}" + } + + return strings.Join([]string{"DeletePartitionColumnStatisticsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_role_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_role_request.go new file mode 100644 index 00000000..60e8a99a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_role_request.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeleteRoleRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // 角色名称 + RoleName string `json:"role_name"` +} + +func (o DeleteRoleRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteRoleRequest struct{}" + } + + return strings.Join([]string{"DeleteRoleRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_role_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_role_response.go new file mode 100644 index 00000000..7fda5c59 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_role_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeleteRoleResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o DeleteRoleResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteRoleResponse struct{}" + } + + return strings.Join([]string{"DeleteRoleResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_column_statistics_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_column_statistics_request.go new file mode 100644 index 00000000..3ce038c9 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_column_statistics_request.go @@ -0,0 +1,35 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeleteTableColumnStatisticsRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + // 被删除的列名,不填写则删除表所有统计信息 + ColumnName *string `json:"column_name,omitempty"` +} + +func (o DeleteTableColumnStatisticsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteTableColumnStatisticsRequest struct{}" + } + + return strings.Join([]string{"DeleteTableColumnStatisticsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_column_statistics_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_column_statistics_response.go new file mode 100644 index 00000000..05801e2b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_column_statistics_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeleteTableColumnStatisticsResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o DeleteTableColumnStatisticsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteTableColumnStatisticsResponse struct{}" + } + + return strings.Join([]string{"DeleteTableColumnStatisticsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_request.go new file mode 100644 index 00000000..165c689d --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_request.go @@ -0,0 +1,35 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeleteTableRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + // 是否删除表中的数据 + DeleteData *bool `json:"delete_data,omitempty"` +} + +func (o DeleteTableRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteTableRequest struct{}" + } + + return strings.Join([]string{"DeleteTableRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_response.go new file mode 100644 index 00000000..2fe7cdab --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_delete_table_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeleteTableResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o DeleteTableResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteTableResponse struct{}" + } + + return strings.Join([]string{"DeleteTableResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_double_column_statistics_data.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_double_column_statistics_data.go new file mode 100644 index 00000000..334ee953 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_double_column_statistics_data.go @@ -0,0 +1,35 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 浮点数统计信息 +type DoubleColumnStatisticsData struct { + + // 列中浮点数最小值 + MinimumValue float64 `json:"minimum_value"` + + // 列中浮点数最大值 + MaximumValue float64 `json:"maximum_value"` + + // 列中空值个数 + NumberOfNull int64 `json:"number_of_null"` + + // 列中去重后浮点数个数 + NumberOfDistinctValue int64 `json:"number_of_distinct_value"` + + // 估算唯一值使用的位图 + BitVector string `json:"bit_vector,omitempty"` +} + +func (o DoubleColumnStatisticsData) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DoubleColumnStatisticsData struct{}" + } + + return strings.Join([]string{"DoubleColumnStatisticsData", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_drop_partitions_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_drop_partitions_input.go new file mode 100644 index 00000000..89501b62 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_drop_partitions_input.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 删除分区信息 +type DropPartitionsInput struct { + + // 是否跳过不存在分区 + IfExist *bool `json:"if_exist,omitempty"` + + // 非事务表:删除分区的数据;若if_purge为真,立即释放空间。 事务表:数据保留但不可见,待数据过期统一删除。 + DeleteData *bool `json:"delete_data,omitempty"` + + // 删除分区值 + PartitionValues [][]string `json:"partition_values"` +} + +func (o DropPartitionsInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DropPartitionsInput struct{}" + } + + return strings.Join([]string{"DropPartitionsInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_foreign_key.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_foreign_key.go new file mode 100644 index 00000000..0209ec67 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_foreign_key.go @@ -0,0 +1,64 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type ForeignKey struct { + + // catalog名称 + CatalogName string `json:"catalog_name"` + + // 被引用表的数据库名 + ParentKeyDatabaseName string `json:"parent_key_database_name"` + + // 被引用表的表名 + ParentKeyTableName string `json:"parent_key_table_name"` + + // 被引用列名 + ParentKeyColumnName string `json:"parent_key_column_name"` + + // 被引用键名称 + ParentKeyName string `json:"parent_key_name"` + + // 引用表的数据库名 + ForeignKeyDatabaseName string `json:"foreign_key_database_name"` + + // 引用表的数据库名 + ForeignKeyTableName string `json:"foreign_key_table_name"` + + // 引用列名 + ForeignKeyColumnName string `json:"foreign_key_column_name"` + + // 外键名称 + ForeignKeyName string `json:"foreign_key_name"` + + // 当被引用表中被引用的记录被删除,本表中对应记录的删除规则 + DeleteRule int32 `json:"delete_rule"` + + // 外键是否启用 + EnableConstraint bool `json:"enable_constraint"` + + // 外键排列规则 + KeySequence int32 `json:"key_sequence"` + + // is foreign Key rely + RelyConstraint bool `json:"rely_constraint"` + + // 当被引用表中被引用的记录被修改,本表中对应记录的更新规则 + UpdateRule int32 `json:"update_rule"` + + // 外键是否可用 + ValidateConstraint bool `json:"validate_constraint"` +} + +func (o ForeignKey) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ForeignKey struct{}" + } + + return strings.Join([]string{"ForeignKey", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_foreign_key_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_foreign_key_input.go new file mode 100644 index 00000000..29832e25 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_foreign_key_input.go @@ -0,0 +1,55 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type ForeignKeyInput struct { + + // 被引用表的数据库名 + ParentKeyDatabaseName string `json:"parent_key_database_name"` + + // 被引用表的表名 + ParentKeyTableName string `json:"parent_key_table_name"` + + // 被引用列名 + ParentKeyColumnName string `json:"parent_key_column_name"` + + // 被引用键名称 + ParentKeyName string `json:"parent_key_name"` + + // 引用列名 + ForeignKeyColumnName string `json:"foreign_key_column_name"` + + // 外键名称 + ForeignKeyName string `json:"foreign_key_name"` + + // 当被引用表中被引用的记录被删除,本表中对应记录的删除规则 + DeleteRule int32 `json:"delete_rule"` + + // 外键是否启用 + EnableConstraint bool `json:"enable_constraint"` + + // 外键排列规则 + KeySequence int32 `json:"key_sequence"` + + // is foreign Key rely + RelyConstraint bool `json:"rely_constraint"` + + // 当被引用表中被引用的记录被修改,本表中对应记录的更新规则 + UpdateRule int32 `json:"update_rule"` + + // 外键是否可用 + ValidateConstraint bool `json:"validate_constraint"` +} + +func (o ForeignKeyInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ForeignKeyInput struct{}" + } + + return strings.Join([]string{"ForeignKeyInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function.go new file mode 100644 index 00000000..31488032 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function.go @@ -0,0 +1,133 @@ +package model + +import ( + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + "strings" +) + +// 函数信息 +type Function struct { + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 函数名 + FunctionName string `json:"function_name"` + + // 函数类型 + FunctionType FunctionFunctionType `json:"function_type"` + + // 函数所有者 + Owner string `json:"owner"` + + // 所有者类型 + OwnerType FunctionOwnerType `json:"owner_type"` + + // 函数类名 + ClassName string `json:"class_name"` + + // 创建时间格式为yyyy-mm-ddThh:mm:sss + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 函数地址信息 + ResourceUris *[]FunctionResourceUri `json:"resource_uris,omitempty"` +} + +func (o Function) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Function struct{}" + } + + return strings.Join([]string{"Function", string(data)}, " ") +} + +type FunctionFunctionType struct { + value string +} + +type FunctionFunctionTypeEnum struct { + JAVA FunctionFunctionType +} + +func GetFunctionFunctionTypeEnum() FunctionFunctionTypeEnum { + return FunctionFunctionTypeEnum{ + JAVA: FunctionFunctionType{ + value: "JAVA", + }, + } +} + +func (c FunctionFunctionType) Value() string { + return c.value +} + +func (c FunctionFunctionType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *FunctionFunctionType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type FunctionOwnerType struct { + value string +} + +type FunctionOwnerTypeEnum struct { + USER FunctionOwnerType + GROUP FunctionOwnerType + ROLE FunctionOwnerType +} + +func GetFunctionOwnerTypeEnum() FunctionOwnerTypeEnum { + return FunctionOwnerTypeEnum{ + USER: FunctionOwnerType{ + value: "USER", + }, + GROUP: FunctionOwnerType{ + value: "GROUP", + }, + ROLE: FunctionOwnerType{ + value: "ROLE", + }, + } +} + +func (c FunctionOwnerType) Value() string { + return c.value +} + +func (c FunctionOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *FunctionOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function_info.go new file mode 100644 index 00000000..5b4f3651 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function_info.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// function input when grant policy +type FunctionInfo struct { + + // function name + Name string `json:"name"` +} + +func (o FunctionInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "FunctionInfo struct{}" + } + + return strings.Join([]string{"FunctionInfo", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function_input.go new file mode 100644 index 00000000..5f8c15f7 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function_input.go @@ -0,0 +1,127 @@ +package model + +import ( + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + "strings" +) + +// 函数信息 +type FunctionInput struct { + + // 函数名 + FunctionName string `json:"function_name"` + + // 函数类型 + FunctionType FunctionInputFunctionType `json:"function_type"` + + // 函数所有者 + Owner string `json:"owner"` + + // 所有者类型 + OwnerType FunctionInputOwnerType `json:"owner_type"` + + // 函数类名 + ClassName string `json:"class_name"` + + // 创建时间格式为yyyy-mm-ddThh:mm:sss + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 函数地址信息 + ResourceUris *[]FunctionResourceUri `json:"resource_uris,omitempty"` +} + +func (o FunctionInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "FunctionInput struct{}" + } + + return strings.Join([]string{"FunctionInput", string(data)}, " ") +} + +type FunctionInputFunctionType struct { + value string +} + +type FunctionInputFunctionTypeEnum struct { + JAVA FunctionInputFunctionType +} + +func GetFunctionInputFunctionTypeEnum() FunctionInputFunctionTypeEnum { + return FunctionInputFunctionTypeEnum{ + JAVA: FunctionInputFunctionType{ + value: "JAVA", + }, + } +} + +func (c FunctionInputFunctionType) Value() string { + return c.value +} + +func (c FunctionInputFunctionType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *FunctionInputFunctionType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type FunctionInputOwnerType struct { + value string +} + +type FunctionInputOwnerTypeEnum struct { + USER FunctionInputOwnerType + GROUP FunctionInputOwnerType + ROLE FunctionInputOwnerType +} + +func GetFunctionInputOwnerTypeEnum() FunctionInputOwnerTypeEnum { + return FunctionInputOwnerTypeEnum{ + USER: FunctionInputOwnerType{ + value: "USER", + }, + GROUP: FunctionInputOwnerType{ + value: "GROUP", + }, + ROLE: FunctionInputOwnerType{ + value: "ROLE", + }, + } +} + +func (c FunctionInputOwnerType) Value() string { + return c.value +} + +func (c FunctionInputOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *FunctionInputOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function_resource_uri.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function_resource_uri.go new file mode 100644 index 00000000..b580fe97 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_function_resource_uri.go @@ -0,0 +1,75 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// 函数包信息 +type FunctionResourceUri struct { + + // 函数包类型 + Type FunctionResourceUriType `json:"type"` + + // 函数包地址信息 + Uri string `json:"uri"` +} + +func (o FunctionResourceUri) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "FunctionResourceUri struct{}" + } + + return strings.Join([]string{"FunctionResourceUri", string(data)}, " ") +} + +type FunctionResourceUriType struct { + value string +} + +type FunctionResourceUriTypeEnum struct { + JAR FunctionResourceUriType + FILE FunctionResourceUriType + ARCHIVE FunctionResourceUriType +} + +func GetFunctionResourceUriTypeEnum() FunctionResourceUriTypeEnum { + return FunctionResourceUriTypeEnum{ + JAR: FunctionResourceUriType{ + value: "JAR", + }, + FILE: FunctionResourceUriType{ + value: "FILE", + }, + ARCHIVE: FunctionResourceUriType{ + value: "ARCHIVE", + }, + } +} + +func (c FunctionResourceUriType) Value() string { + return c.value +} + +func (c FunctionResourceUriType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *FunctionResourceUriType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_get_partition_column_statistics_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_get_partition_column_statistics_input.go new file mode 100644 index 00000000..2b0d6571 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_get_partition_column_statistics_input.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 获取指定分区指定列的列统计信息 +type GetPartitionColumnStatisticsInput struct { + + // 是否聚合返回统计信息 + AggregateStatics bool `json:"aggregate_statics"` + + // 统计信息的列名 + ColumnNames []string `json:"column_names"` + + // 需要统计的分区值列表 + PartitionValuesList [][]string `json:"partition_values_list"` +} + +func (o GetPartitionColumnStatisticsInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "GetPartitionColumnStatisticsInput struct{}" + } + + return strings.Join([]string{"GetPartitionColumnStatisticsInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_get_partitions_by_values_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_get_partitions_by_values_input.go new file mode 100644 index 00000000..1d8c6ef6 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_get_partitions_by_values_input.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type GetPartitionsByValuesInput struct { + + // 获取的分区列表每个分区值列表代表一个分区 + Values [][]string `json:"values"` +} + +func (o GetPartitionsByValuesInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "GetPartitionsByValuesInput struct{}" + } + + return strings.Join([]string{"GetPartitionsByValuesInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_get_table_column_statistics_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_get_table_column_statistics_input.go new file mode 100644 index 00000000..d40f6166 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_get_table_column_statistics_input.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 获取表列统计信息输入参数 +type GetTableColumnStatisticsInput struct { + + // 列名 + ColumnNames []string `json:"column_names"` +} + +func (o GetTableColumnStatisticsInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "GetTableColumnStatisticsInput struct{}" + } + + return strings.Join([]string{"GetTableColumnStatisticsInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_lake_formation_instance.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_lake_formation_instance.go new file mode 100644 index 00000000..26459fc0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_lake_formation_instance.go @@ -0,0 +1,48 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// LakeFormation实例详细信息 +type LakeFormationInstance struct { + + // LakeFormation实例Id + InstanceId *string `json:"instance_id,omitempty"` + + // 实例名 + Name *string `json:"name,omitempty"` + + // 描述 + Description *string `json:"description,omitempty"` + + // 企业项目Id + EnterpriseProjectId *string `json:"enterprise_project_id,omitempty"` + + // 逻辑多租和物理多租的判断 + Shared *bool `json:"shared,omitempty"` + + // 实例创建时间戳 + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 实例更新时间戳 + UpdateTime *sdktime.SdkTime `json:"update_time,omitempty"` + + // 实例状态 + Status *string `json:"status,omitempty"` + + // 是否在回收站 + InRecycleBin *bool `json:"in_recycle_bin,omitempty"` +} + +func (o LakeFormationInstance) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "LakeFormationInstance struct{}" + } + + return strings.Join([]string{"LakeFormationInstance", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_lake_formation_policy.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_lake_formation_policy.go new file mode 100644 index 00000000..e32a5581 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_lake_formation_policy.go @@ -0,0 +1,405 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// LakeFormationPolicy +type LakeFormationPolicy struct { + + // 项目id + ProjectId string `json:"project_id"` + + // 实例id + InstanceId *string `json:"instance_id,omitempty"` + + // 主体类型,USER-用户,GROUP-组,ROLE-角色,SHARE-共享,OTHER-其它 + PrincipalType LakeFormationPolicyPrincipalType `json:"principal_type"` + + // 主体来源,IAM-云,SAML-联邦,LDAP-权限策略,LOCAL-本地,OTHER-其它 + PrincipalSource LakeFormationPolicyPrincipalSource `json:"principal_source"` + + // 主体名 + PrincipalName string `json:"principal_name"` + + Resource *ResourceInfo `json:"resource,omitempty"` + + // 要求用点分格式进行分割 + ResourceName string `json:"resource_name"` + + // 权限列表 + Permissions []LakeFormationPolicyPermissions `json:"permissions"` + + // 可以传递的权限列表 + GrantAblePermissions *[]LakeFormationPolicyGrantAblePermissions `json:"grant_able_permissions,omitempty"` + + // 创建时间 + CreatedTime int64 `json:"created_time"` + + // 条件信息 + Condition *string `json:"condition,omitempty"` + + // obligation,义务,当前包含data filter和data mask + Obligation *string `json:"obligation,omitempty"` + + // 授权路径列表 + AuthorizationPaths *[]string `json:"authorization_paths,omitempty"` +} + +func (o LakeFormationPolicy) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "LakeFormationPolicy struct{}" + } + + return strings.Join([]string{"LakeFormationPolicy", string(data)}, " ") +} + +type LakeFormationPolicyPrincipalType struct { + value string +} + +type LakeFormationPolicyPrincipalTypeEnum struct { + USER LakeFormationPolicyPrincipalType + GROUP LakeFormationPolicyPrincipalType + ROLE LakeFormationPolicyPrincipalType + SHARE LakeFormationPolicyPrincipalType + OTHER LakeFormationPolicyPrincipalType +} + +func GetLakeFormationPolicyPrincipalTypeEnum() LakeFormationPolicyPrincipalTypeEnum { + return LakeFormationPolicyPrincipalTypeEnum{ + USER: LakeFormationPolicyPrincipalType{ + value: "USER", + }, + GROUP: LakeFormationPolicyPrincipalType{ + value: "GROUP", + }, + ROLE: LakeFormationPolicyPrincipalType{ + value: "ROLE", + }, + SHARE: LakeFormationPolicyPrincipalType{ + value: "SHARE", + }, + OTHER: LakeFormationPolicyPrincipalType{ + value: "OTHER", + }, + } +} + +func (c LakeFormationPolicyPrincipalType) Value() string { + return c.value +} + +func (c LakeFormationPolicyPrincipalType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *LakeFormationPolicyPrincipalType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type LakeFormationPolicyPrincipalSource struct { + value string +} + +type LakeFormationPolicyPrincipalSourceEnum struct { + IAM LakeFormationPolicyPrincipalSource + SAML LakeFormationPolicyPrincipalSource + LDAP LakeFormationPolicyPrincipalSource + LOCAL LakeFormationPolicyPrincipalSource + OTHER LakeFormationPolicyPrincipalSource +} + +func GetLakeFormationPolicyPrincipalSourceEnum() LakeFormationPolicyPrincipalSourceEnum { + return LakeFormationPolicyPrincipalSourceEnum{ + IAM: LakeFormationPolicyPrincipalSource{ + value: "IAM", + }, + SAML: LakeFormationPolicyPrincipalSource{ + value: "SAML", + }, + LDAP: LakeFormationPolicyPrincipalSource{ + value: "LDAP", + }, + LOCAL: LakeFormationPolicyPrincipalSource{ + value: "LOCAL", + }, + OTHER: LakeFormationPolicyPrincipalSource{ + value: "OTHER", + }, + } +} + +func (c LakeFormationPolicyPrincipalSource) Value() string { + return c.value +} + +func (c LakeFormationPolicyPrincipalSource) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *LakeFormationPolicyPrincipalSource) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type LakeFormationPolicyPermissions struct { + value string +} + +type LakeFormationPolicyPermissionsEnum struct { + ALL LakeFormationPolicyPermissions + CREATE LakeFormationPolicyPermissions + ALTER LakeFormationPolicyPermissions + DROP LakeFormationPolicyPermissions + DESCRIBE LakeFormationPolicyPermissions + EXEC LakeFormationPolicyPermissions + CREATE_DATABASE LakeFormationPolicyPermissions + LIST_DATABASE LakeFormationPolicyPermissions + CREATE_TABLE LakeFormationPolicyPermissions + LIST_TABLE LakeFormationPolicyPermissions + CREATE_FUNC LakeFormationPolicyPermissions + LIST_FUNC LakeFormationPolicyPermissions + REGISTER_MODEL LakeFormationPolicyPermissions + LIST_MODEL LakeFormationPolicyPermissions + INSERT LakeFormationPolicyPermissions + UPDATE LakeFormationPolicyPermissions + DELETE LakeFormationPolicyPermissions + SELECT LakeFormationPolicyPermissions + READ LakeFormationPolicyPermissions + WRITE LakeFormationPolicyPermissions + OPERATE LakeFormationPolicyPermissions +} + +func GetLakeFormationPolicyPermissionsEnum() LakeFormationPolicyPermissionsEnum { + return LakeFormationPolicyPermissionsEnum{ + ALL: LakeFormationPolicyPermissions{ + value: "ALL", + }, + CREATE: LakeFormationPolicyPermissions{ + value: "CREATE", + }, + ALTER: LakeFormationPolicyPermissions{ + value: "ALTER", + }, + DROP: LakeFormationPolicyPermissions{ + value: "DROP", + }, + DESCRIBE: LakeFormationPolicyPermissions{ + value: "DESCRIBE", + }, + EXEC: LakeFormationPolicyPermissions{ + value: "EXEC", + }, + CREATE_DATABASE: LakeFormationPolicyPermissions{ + value: "CREATE_DATABASE", + }, + LIST_DATABASE: LakeFormationPolicyPermissions{ + value: "LIST_DATABASE", + }, + CREATE_TABLE: LakeFormationPolicyPermissions{ + value: "CREATE_TABLE", + }, + LIST_TABLE: LakeFormationPolicyPermissions{ + value: "LIST_TABLE", + }, + CREATE_FUNC: LakeFormationPolicyPermissions{ + value: "CREATE_FUNC", + }, + LIST_FUNC: LakeFormationPolicyPermissions{ + value: "LIST_FUNC", + }, + REGISTER_MODEL: LakeFormationPolicyPermissions{ + value: "REGISTER_MODEL", + }, + LIST_MODEL: LakeFormationPolicyPermissions{ + value: "LIST_MODEL", + }, + INSERT: LakeFormationPolicyPermissions{ + value: "INSERT", + }, + UPDATE: LakeFormationPolicyPermissions{ + value: "UPDATE", + }, + DELETE: LakeFormationPolicyPermissions{ + value: "DELETE", + }, + SELECT: LakeFormationPolicyPermissions{ + value: "SELECT", + }, + READ: LakeFormationPolicyPermissions{ + value: "READ", + }, + WRITE: LakeFormationPolicyPermissions{ + value: "WRITE", + }, + OPERATE: LakeFormationPolicyPermissions{ + value: "OPERATE", + }, + } +} + +func (c LakeFormationPolicyPermissions) Value() string { + return c.value +} + +func (c LakeFormationPolicyPermissions) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *LakeFormationPolicyPermissions) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type LakeFormationPolicyGrantAblePermissions struct { + value string +} + +type LakeFormationPolicyGrantAblePermissionsEnum struct { + ALL LakeFormationPolicyGrantAblePermissions + CREATE LakeFormationPolicyGrantAblePermissions + ALTER LakeFormationPolicyGrantAblePermissions + DROP LakeFormationPolicyGrantAblePermissions + DESCRIBE LakeFormationPolicyGrantAblePermissions + EXEC LakeFormationPolicyGrantAblePermissions + CREATE_DATABASE LakeFormationPolicyGrantAblePermissions + LIST_DATABASE LakeFormationPolicyGrantAblePermissions + CREATE_TABLE LakeFormationPolicyGrantAblePermissions + LIST_TABLE LakeFormationPolicyGrantAblePermissions + CREATE_FUNC LakeFormationPolicyGrantAblePermissions + LIST_FUNC LakeFormationPolicyGrantAblePermissions + REGISTER_MODEL LakeFormationPolicyGrantAblePermissions + LIST_MODEL LakeFormationPolicyGrantAblePermissions + INSERT LakeFormationPolicyGrantAblePermissions + UPDATE LakeFormationPolicyGrantAblePermissions + DELETE LakeFormationPolicyGrantAblePermissions + SELECT LakeFormationPolicyGrantAblePermissions + READ LakeFormationPolicyGrantAblePermissions + WRITE LakeFormationPolicyGrantAblePermissions + OPERATE LakeFormationPolicyGrantAblePermissions +} + +func GetLakeFormationPolicyGrantAblePermissionsEnum() LakeFormationPolicyGrantAblePermissionsEnum { + return LakeFormationPolicyGrantAblePermissionsEnum{ + ALL: LakeFormationPolicyGrantAblePermissions{ + value: "ALL", + }, + CREATE: LakeFormationPolicyGrantAblePermissions{ + value: "CREATE", + }, + ALTER: LakeFormationPolicyGrantAblePermissions{ + value: "ALTER", + }, + DROP: LakeFormationPolicyGrantAblePermissions{ + value: "DROP", + }, + DESCRIBE: LakeFormationPolicyGrantAblePermissions{ + value: "DESCRIBE", + }, + EXEC: LakeFormationPolicyGrantAblePermissions{ + value: "EXEC", + }, + CREATE_DATABASE: LakeFormationPolicyGrantAblePermissions{ + value: "CREATE_DATABASE", + }, + LIST_DATABASE: LakeFormationPolicyGrantAblePermissions{ + value: "LIST_DATABASE", + }, + CREATE_TABLE: LakeFormationPolicyGrantAblePermissions{ + value: "CREATE_TABLE", + }, + LIST_TABLE: LakeFormationPolicyGrantAblePermissions{ + value: "LIST_TABLE", + }, + CREATE_FUNC: LakeFormationPolicyGrantAblePermissions{ + value: "CREATE_FUNC", + }, + LIST_FUNC: LakeFormationPolicyGrantAblePermissions{ + value: "LIST_FUNC", + }, + REGISTER_MODEL: LakeFormationPolicyGrantAblePermissions{ + value: "REGISTER_MODEL", + }, + LIST_MODEL: LakeFormationPolicyGrantAblePermissions{ + value: "LIST_MODEL", + }, + INSERT: LakeFormationPolicyGrantAblePermissions{ + value: "INSERT", + }, + UPDATE: LakeFormationPolicyGrantAblePermissions{ + value: "UPDATE", + }, + DELETE: LakeFormationPolicyGrantAblePermissions{ + value: "DELETE", + }, + SELECT: LakeFormationPolicyGrantAblePermissions{ + value: "SELECT", + }, + READ: LakeFormationPolicyGrantAblePermissions{ + value: "READ", + }, + WRITE: LakeFormationPolicyGrantAblePermissions{ + value: "WRITE", + }, + OPERATE: LakeFormationPolicyGrantAblePermissions{ + value: "OPERATE", + }, + } +} + +func (c LakeFormationPolicyGrantAblePermissions) Value() string { + return c.value +} + +func (c LakeFormationPolicyGrantAblePermissions) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *LakeFormationPolicyGrantAblePermissions) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_access_infos_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_access_infos_request.go new file mode 100644 index 00000000..09aaea95 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_access_infos_request.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListAccessInfosRequest struct { + + // LakeFormation实例ID + InstanceId string `json:"instance_id"` + + // 分页查询时的偏移量 + Offset int32 `json:"offset"` + + // 分页一页显示数 + Limit *int32 `json:"limit,omitempty"` +} + +func (o ListAccessInfosRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListAccessInfosRequest struct{}" + } + + return strings.Join([]string{"ListAccessInfosRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_access_infos_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_access_infos_response.go new file mode 100644 index 00000000..71098392 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_access_infos_response.go @@ -0,0 +1,27 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListAccessInfosResponse struct { + + // accessinfo列表 + AccessInfos *[]AccessInfo `json:"access_infos,omitempty"` + + // accessinfo总数 + Total *int32 `json:"total,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListAccessInfosResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListAccessInfosResponse struct{}" + } + + return strings.Join([]string{"ListAccessInfosResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_all_functions_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_all_functions_request.go new file mode 100644 index 00000000..dae4cda0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_all_functions_request.go @@ -0,0 +1,35 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListAllFunctionsRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 查询返回条数 + Limit *int32 `json:"limit,omitempty"` + + // 查询的起始记录ID + Marker *string `json:"marker,omitempty"` + + // 是否查询上一页 + ReversePage *bool `json:"reverse_page,omitempty"` +} + +func (o ListAllFunctionsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListAllFunctionsRequest struct{}" + } + + return strings.Join([]string{"ListAllFunctionsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_all_functions_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_all_functions_response.go new file mode 100644 index 00000000..d8fd7065 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_all_functions_response.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListAllFunctionsResponse struct { + PageInfo *PagedInfo `json:"page_info,omitempty"` + + Functions *[]Function `json:"functions,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListAllFunctionsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListAllFunctionsResponse struct{}" + } + + return strings.Join([]string{"ListAllFunctionsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_catalogs_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_catalogs_request.go new file mode 100644 index 00000000..046a2ddb --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_catalogs_request.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListCatalogsRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` +} + +func (o ListCatalogsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListCatalogsRequest struct{}" + } + + return strings.Join([]string{"ListCatalogsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_catalogs_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_catalogs_response.go new file mode 100644 index 00000000..93c7992c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_catalogs_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListCatalogsResponse struct { + Body *[]Catalog `json:"body,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListCatalogsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListCatalogsResponse struct{}" + } + + return strings.Join([]string{"ListCatalogsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_constraints_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_constraints_request.go new file mode 100644 index 00000000..cb9df248 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_constraints_request.go @@ -0,0 +1,102 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// Request Object +type ListConstraintsRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + // 列限制条件类型 + Type ListConstraintsRequestType `json:"type"` + + // 获取表外键时使用,指定外键被引用表所在的数据库名 + ParentDb *string `json:"parent_db,omitempty"` + + // 获取表外键时使用,指定外键被引用表的表名 + ParentTbl *string `json:"parent_tbl,omitempty"` +} + +func (o ListConstraintsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListConstraintsRequest struct{}" + } + + return strings.Join([]string{"ListConstraintsRequest", string(data)}, " ") +} + +type ListConstraintsRequestType struct { + value string +} + +type ListConstraintsRequestTypeEnum struct { + CHECK_CSTR ListConstraintsRequestType + DEFAULT_CSTR ListConstraintsRequestType + NOT_NULL_CSTR ListConstraintsRequestType + UNIQUE_CSTR ListConstraintsRequestType + PRIMARY_KEY ListConstraintsRequestType + FOREIGN_KEY ListConstraintsRequestType +} + +func GetListConstraintsRequestTypeEnum() ListConstraintsRequestTypeEnum { + return ListConstraintsRequestTypeEnum{ + CHECK_CSTR: ListConstraintsRequestType{ + value: "CHECK_CSTR", + }, + DEFAULT_CSTR: ListConstraintsRequestType{ + value: "DEFAULT_CSTR", + }, + NOT_NULL_CSTR: ListConstraintsRequestType{ + value: "NOT_NULL_CSTR", + }, + UNIQUE_CSTR: ListConstraintsRequestType{ + value: "UNIQUE_CSTR", + }, + PRIMARY_KEY: ListConstraintsRequestType{ + value: "PRIMARY_KEY", + }, + FOREIGN_KEY: ListConstraintsRequestType{ + value: "FOREIGN_KEY", + }, + } +} + +func (c ListConstraintsRequestType) Value() string { + return c.value +} + +func (c ListConstraintsRequestType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ListConstraintsRequestType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_constraints_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_constraints_response.go new file mode 100644 index 00000000..505a9dd0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_constraints_response.go @@ -0,0 +1,103 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// Response Object +type ListConstraintsResponse struct { + + // 限制类型 + ConstraintType *ListConstraintsResponseConstraintType `json:"constraint_type,omitempty"` + + // 外键列表 + ForeignKeys *[]ForeignKey `json:"foreign_keys,omitempty"` + + // 主键列表 + PrimaryKeys *[]PrimaryKey `json:"primary_keys,omitempty"` + + // 非空限制列表 + NotNullConstraints *[]NotNullConstraint `json:"not_null_constraints,omitempty"` + + // 检查限制列表 + CheckConstraints *[]CheckConstraint `json:"check_constraints,omitempty"` + + // 唯一值限制列表 + UniqueConstraints *[]UniqueConstraint `json:"unique_constraints,omitempty"` + + // 默认限制列表 + DefaultConstraints *[]DefaultConstraint `json:"default_constraints,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListConstraintsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListConstraintsResponse struct{}" + } + + return strings.Join([]string{"ListConstraintsResponse", string(data)}, " ") +} + +type ListConstraintsResponseConstraintType struct { + value string +} + +type ListConstraintsResponseConstraintTypeEnum struct { + CHECK_CSTR ListConstraintsResponseConstraintType + DEFAULT_CSTR ListConstraintsResponseConstraintType + NOT_NULL_CSTR ListConstraintsResponseConstraintType + UNIQUE_CSTR ListConstraintsResponseConstraintType + PRIMARY_KEY ListConstraintsResponseConstraintType + FOREIGN_KEY ListConstraintsResponseConstraintType +} + +func GetListConstraintsResponseConstraintTypeEnum() ListConstraintsResponseConstraintTypeEnum { + return ListConstraintsResponseConstraintTypeEnum{ + CHECK_CSTR: ListConstraintsResponseConstraintType{ + value: "CHECK_CSTR", + }, + DEFAULT_CSTR: ListConstraintsResponseConstraintType{ + value: "DEFAULT_CSTR", + }, + NOT_NULL_CSTR: ListConstraintsResponseConstraintType{ + value: "NOT_NULL_CSTR", + }, + UNIQUE_CSTR: ListConstraintsResponseConstraintType{ + value: "UNIQUE_CSTR", + }, + PRIMARY_KEY: ListConstraintsResponseConstraintType{ + value: "PRIMARY_KEY", + }, + FOREIGN_KEY: ListConstraintsResponseConstraintType{ + value: "FOREIGN_KEY", + }, + } +} + +func (c ListConstraintsResponseConstraintType) Value() string { + return c.value +} + +func (c ListConstraintsResponseConstraintType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ListConstraintsResponseConstraintType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_database_names_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_database_names_request.go new file mode 100644 index 00000000..0cb9c0e3 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_database_names_request.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListDatabaseNamesRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字通配符 + DatabasePattern *string `json:"database_pattern,omitempty"` +} + +func (o ListDatabaseNamesRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListDatabaseNamesRequest struct{}" + } + + return strings.Join([]string{"ListDatabaseNamesRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_database_names_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_database_names_response.go new file mode 100644 index 00000000..86431d27 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_database_names_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListDatabaseNamesResponse struct { + Body *[]string `json:"body,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListDatabaseNamesResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListDatabaseNamesResponse struct{}" + } + + return strings.Join([]string{"ListDatabaseNamesResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_databases_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_databases_request.go new file mode 100644 index 00000000..9b05b7a8 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_databases_request.go @@ -0,0 +1,38 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListDatabasesRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字通配符 + DatabaseNamePattern *string `json:"database_name_pattern,omitempty"` + + // 返回的条目数量 + Limit *int32 `json:"limit,omitempty"` + + // 查询的起始记录ID + Marker *string `json:"marker,omitempty"` + + // 是否查询上一页 + ReversePage *bool `json:"reverse_page,omitempty"` +} + +func (o ListDatabasesRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListDatabasesRequest struct{}" + } + + return strings.Join([]string{"ListDatabasesRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_databases_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_databases_response.go new file mode 100644 index 00000000..99a3a8bc --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_databases_response.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListDatabasesResponse struct { + Databases *[]Database `json:"databases,omitempty"` + + PageInfo *PagedInfo `json:"page_info,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListDatabasesResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListDatabasesResponse struct{}" + } + + return strings.Join([]string{"ListDatabasesResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_functions_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_functions_request.go new file mode 100644 index 00000000..4fabea9c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_functions_request.go @@ -0,0 +1,41 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListFunctionsRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 函数名通配符 + FunctionNamePattern *string `json:"function_name_pattern,omitempty"` + + // 查询返回满足条件的function数量 + Limit *int32 `json:"limit,omitempty"` + + // 当前查询的起始位置 + Marker *string `json:"marker,omitempty"` + + // 是否查询上一页 + ReversePage *bool `json:"reverse_page,omitempty"` +} + +func (o ListFunctionsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListFunctionsRequest struct{}" + } + + return strings.Join([]string{"ListFunctionsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_functions_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_functions_response.go new file mode 100644 index 00000000..fa573621 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_functions_response.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListFunctionsResponse struct { + PageInfo *PagedInfo `json:"page_info,omitempty"` + + Functions *[]Function `json:"functions,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListFunctionsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListFunctionsResponse struct{}" + } + + return strings.Join([]string{"ListFunctionsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_groups_for_domain_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_groups_for_domain_request.go new file mode 100644 index 00000000..3603cb2d --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_groups_for_domain_request.go @@ -0,0 +1,88 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// Request Object +type ListGroupsForDomainRequest struct { + + // instance id + InstanceId string `json:"instance_id"` + + // 查询的用户组来源 + GroupSource *ListGroupsForDomainRequestGroupSource `json:"group_source,omitempty"` + + // 返回的条目数量 + Limit *int32 `json:"limit,omitempty"` + + // 查询的起始记录ID + Marker *string `json:"marker,omitempty"` + + // 是否查询上一页 + ReversePage *bool `json:"reverse_page,omitempty"` +} + +func (o ListGroupsForDomainRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListGroupsForDomainRequest struct{}" + } + + return strings.Join([]string{"ListGroupsForDomainRequest", string(data)}, " ") +} + +type ListGroupsForDomainRequestGroupSource struct { + value string +} + +type ListGroupsForDomainRequestGroupSourceEnum struct { + IAM ListGroupsForDomainRequestGroupSource + SAML ListGroupsForDomainRequestGroupSource + LDAP ListGroupsForDomainRequestGroupSource + LOCAL ListGroupsForDomainRequestGroupSource +} + +func GetListGroupsForDomainRequestGroupSourceEnum() ListGroupsForDomainRequestGroupSourceEnum { + return ListGroupsForDomainRequestGroupSourceEnum{ + IAM: ListGroupsForDomainRequestGroupSource{ + value: "IAM", + }, + SAML: ListGroupsForDomainRequestGroupSource{ + value: "SAML", + }, + LDAP: ListGroupsForDomainRequestGroupSource{ + value: "LDAP", + }, + LOCAL: ListGroupsForDomainRequestGroupSource{ + value: "LOCAL", + }, + } +} + +func (c ListGroupsForDomainRequestGroupSource) Value() string { + return c.value +} + +func (c ListGroupsForDomainRequestGroupSource) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ListGroupsForDomainRequestGroupSource) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_groups_for_domain_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_groups_for_domain_response.go new file mode 100644 index 00000000..6f564740 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_groups_for_domain_response.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListGroupsForDomainResponse struct { + UserGroup *[]UserGroup `json:"user_group,omitempty"` + + PageInfo *PagedInfo `json:"page_info,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListGroupsForDomainResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListGroupsForDomainResponse struct{}" + } + + return strings.Join([]string{"ListGroupsForDomainResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_interfaces_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_interfaces_request.go new file mode 100644 index 00000000..e1542365 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_interfaces_request.go @@ -0,0 +1,216 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// Request Object +type ListInterfacesRequest struct { + + // instance id + InstanceId string `json:"instance_id"` + + // expression + Filter *string `json:"filter,omitempty"` + + // 元数据资源全名 + ResourceName *string `json:"resource_name,omitempty"` + + // 元数据资源类型 + ResourceType *ListInterfacesRequestResourceType `json:"resource_type,omitempty"` + + // 授权主体来源 + PrincipalSource *ListInterfacesRequestPrincipalSource `json:"principal_source,omitempty"` + + // 授权主体类型 + PrincipalType *ListInterfacesRequestPrincipalType `json:"principal_type,omitempty"` + + // 授权主体名称 + PrincipalName *string `json:"principal_name,omitempty"` + + // limit + Limit *int32 `json:"limit,omitempty"` + + // page token + Marker *string `json:"marker,omitempty"` +} + +func (o ListInterfacesRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListInterfacesRequest struct{}" + } + + return strings.Join([]string{"ListInterfacesRequest", string(data)}, " ") +} + +type ListInterfacesRequestResourceType struct { + value string +} + +type ListInterfacesRequestResourceTypeEnum struct { + CATALOG ListInterfacesRequestResourceType + DATABASE ListInterfacesRequestResourceType + TABLE ListInterfacesRequestResourceType + FUNC ListInterfacesRequestResourceType + MODEL ListInterfacesRequestResourceType + COLUMN ListInterfacesRequestResourceType + URI ListInterfacesRequestResourceType +} + +func GetListInterfacesRequestResourceTypeEnum() ListInterfacesRequestResourceTypeEnum { + return ListInterfacesRequestResourceTypeEnum{ + CATALOG: ListInterfacesRequestResourceType{ + value: "CATALOG", + }, + DATABASE: ListInterfacesRequestResourceType{ + value: "DATABASE", + }, + TABLE: ListInterfacesRequestResourceType{ + value: "TABLE", + }, + FUNC: ListInterfacesRequestResourceType{ + value: "FUNC", + }, + MODEL: ListInterfacesRequestResourceType{ + value: "MODEL", + }, + COLUMN: ListInterfacesRequestResourceType{ + value: "COLUMN", + }, + URI: ListInterfacesRequestResourceType{ + value: "URI", + }, + } +} + +func (c ListInterfacesRequestResourceType) Value() string { + return c.value +} + +func (c ListInterfacesRequestResourceType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ListInterfacesRequestResourceType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type ListInterfacesRequestPrincipalSource struct { + value string +} + +type ListInterfacesRequestPrincipalSourceEnum struct { + IAM ListInterfacesRequestPrincipalSource + SAML ListInterfacesRequestPrincipalSource + LDAP ListInterfacesRequestPrincipalSource + LOCAL ListInterfacesRequestPrincipalSource +} + +func GetListInterfacesRequestPrincipalSourceEnum() ListInterfacesRequestPrincipalSourceEnum { + return ListInterfacesRequestPrincipalSourceEnum{ + IAM: ListInterfacesRequestPrincipalSource{ + value: "IAM", + }, + SAML: ListInterfacesRequestPrincipalSource{ + value: "SAML", + }, + LDAP: ListInterfacesRequestPrincipalSource{ + value: "LDAP", + }, + LOCAL: ListInterfacesRequestPrincipalSource{ + value: "LOCAL", + }, + } +} + +func (c ListInterfacesRequestPrincipalSource) Value() string { + return c.value +} + +func (c ListInterfacesRequestPrincipalSource) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ListInterfacesRequestPrincipalSource) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type ListInterfacesRequestPrincipalType struct { + value string +} + +type ListInterfacesRequestPrincipalTypeEnum struct { + USER ListInterfacesRequestPrincipalType + GROUP ListInterfacesRequestPrincipalType + ROLE ListInterfacesRequestPrincipalType + SHARE ListInterfacesRequestPrincipalType + OTHER ListInterfacesRequestPrincipalType +} + +func GetListInterfacesRequestPrincipalTypeEnum() ListInterfacesRequestPrincipalTypeEnum { + return ListInterfacesRequestPrincipalTypeEnum{ + USER: ListInterfacesRequestPrincipalType{ + value: "USER", + }, + GROUP: ListInterfacesRequestPrincipalType{ + value: "GROUP", + }, + ROLE: ListInterfacesRequestPrincipalType{ + value: "ROLE", + }, + SHARE: ListInterfacesRequestPrincipalType{ + value: "SHARE", + }, + OTHER: ListInterfacesRequestPrincipalType{ + value: "OTHER", + }, + } +} + +func (c ListInterfacesRequestPrincipalType) Value() string { + return c.value +} + +func (c ListInterfacesRequestPrincipalType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ListInterfacesRequestPrincipalType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_interfaces_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_interfaces_response.go new file mode 100644 index 00000000..73881252 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_interfaces_response.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListInterfacesResponse struct { + + // lakecat策略信息 + Policies *[]LakeFormationPolicy `json:"policies,omitempty"` + + PageInfo *PagedInfo `json:"page_info,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListInterfacesResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListInterfacesResponse struct{}" + } + + return strings.Join([]string{"ListInterfacesResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_lake_formation_instances_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_lake_formation_instances_request.go new file mode 100644 index 00000000..465b95bb --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_lake_formation_instances_request.go @@ -0,0 +1,38 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListLakeFormationInstancesRequest struct { + + // 是否查询回收站中的实例 + InRecycleBin bool `json:"in_recycle_bin"` + + // 分页查询时的偏移量 + Offset int32 `json:"offset"` + + // 分页一页显示数 + Limit int32 `json:"limit"` + + // 使用LakeFormation实例名进行检索 + Name *string `json:"name,omitempty"` + + // 企业项目id + EnterpriseProjectId string `json:"enterprise_project_id"` + + // 标签条件列表 + Tags *string `json:"tags,omitempty"` +} + +func (o ListLakeFormationInstancesRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListLakeFormationInstancesRequest struct{}" + } + + return strings.Join([]string{"ListLakeFormationInstancesRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_lake_formation_instances_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_lake_formation_instances_response.go new file mode 100644 index 00000000..04971f84 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_lake_formation_instances_response.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListLakeFormationInstancesResponse struct { + + // LakeFormation实例列表 + Instances *[]LakeFormationInstance `json:"instances,omitempty"` + + // LakeFormation实例总数 + Total *int32 `json:"total,omitempty"` + + XRequestId *string `json:"X-request-id,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListLakeFormationInstancesResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListLakeFormationInstancesResponse struct{}" + } + + return strings.Join([]string{"ListLakeFormationInstancesResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_buckets_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_buckets_request.go new file mode 100644 index 00000000..32d51247 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_buckets_request.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListObsBucketsRequest struct { + + // 分页查询时的偏移量 + Offset *int32 `json:"offset,omitempty"` + + // 分页一页显示数 + Limit *int32 `json:"limit,omitempty"` +} + +func (o ListObsBucketsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListObsBucketsRequest struct{}" + } + + return strings.Join([]string{"ListObsBucketsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_buckets_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_buckets_response.go new file mode 100644 index 00000000..daef155b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_buckets_response.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListObsBucketsResponse struct { + + // obs桶列表 + Buckets *[]BucketDetail `json:"buckets,omitempty"` + + // obs桶总数 + Total *int32 `json:"total,omitempty"` + + XRequestId *string `json:"X-request-id,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListObsBucketsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListObsBucketsResponse struct{}" + } + + return strings.Join([]string{"ListObsBucketsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_object_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_object_request.go new file mode 100644 index 00000000..b5a3e39d --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_object_request.go @@ -0,0 +1,32 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListObsObjectRequest struct { + + // obs桶名称 + BucketName string `json:"bucket_name"` + + // 查询起始object名称 + Marker *string `json:"marker,omitempty"` + + // 单次查询条数 + Limit int32 `json:"limit"` + + // 搜索前缀 + Prefix *string `json:"prefix,omitempty"` +} + +func (o ListObsObjectRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListObsObjectRequest struct{}" + } + + return strings.Join([]string{"ListObsObjectRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_object_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_object_response.go new file mode 100644 index 00000000..3d70f5fa --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_obs_object_response.go @@ -0,0 +1,36 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListObsObjectResponse struct { + + // object名称列表 + ObjectNames *[]string `json:"object_names,omitempty"` + + // region编码 + Location *string `json:"location,omitempty"` + + // 搜索前缀 + Prefix *string `json:"prefix,omitempty"` + + // obs桶名 + BucketName *string `json:"bucket_name,omitempty"` + + // 下一个object起始位置 + NextMarker *string `json:"next_marker,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListObsObjectResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListObsObjectResponse struct{}" + } + + return strings.Join([]string{"ListObsObjectResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partition_names_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partition_names_request.go new file mode 100644 index 00000000..dc6369fd --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partition_names_request.go @@ -0,0 +1,44 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListPartitionNamesRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + // 过滤条件表达式 + Filter *string `json:"filter,omitempty"` + + // 查询返回条数 + Limit *int32 `json:"limit,omitempty"` + + // 查询的起始记录ID + Marker *string `json:"marker,omitempty"` + + // 是否查询上一页 + ReversePage *bool `json:"reverse_page,omitempty"` +} + +func (o ListPartitionNamesRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListPartitionNamesRequest struct{}" + } + + return strings.Join([]string{"ListPartitionNamesRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partition_names_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partition_names_response.go new file mode 100644 index 00000000..3bd88b19 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partition_names_response.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListPartitionNamesResponse struct { + + // 分区名字列表 + PartitionNameList *[]string `json:"partition_name_list,omitempty"` + + PageInfo *PagedInfo `json:"page_info,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListPartitionNamesResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListPartitionNamesResponse struct{}" + } + + return strings.Join([]string{"ListPartitionNamesResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partitions_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partitions_request.go new file mode 100644 index 00000000..8a74a871 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partitions_request.go @@ -0,0 +1,47 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListPartitionsRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + // 分区过滤条件 + Filter *string `json:"filter,omitempty"` + + // 分区的值列表 + PartitionValues *[]string `json:"partition_values,omitempty"` + + // 查询返回条数 + Limit *int32 `json:"limit,omitempty"` + + // 查询的起始记录ID + Marker *string `json:"marker,omitempty"` + + // 是否查询上一页 + ReversePage *bool `json:"reverse_page,omitempty"` +} + +func (o ListPartitionsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListPartitionsRequest struct{}" + } + + return strings.Join([]string{"ListPartitionsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partitions_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partitions_response.go new file mode 100644 index 00000000..58508844 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_partitions_response.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListPartitionsResponse struct { + Partitions *[]Partition `json:"partitions,omitempty"` + + PageInfo *PagedInfo `json:"page_info,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListPartitionsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListPartitionsResponse struct{}" + } + + return strings.Join([]string{"ListPartitionsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_policy_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_policy_request.go new file mode 100644 index 00000000..9e061da2 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_policy_request.go @@ -0,0 +1,32 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListPolicyRequest struct { + + // instance id + InstanceId string `json:"instance_id"` + + // limit + Limit *int32 `json:"limit,omitempty"` + + // marker + Marker *string `json:"marker,omitempty"` + + // 是否查询上一页 + ReversePage *bool `json:"reverse_page,omitempty"` +} + +func (o ListPolicyRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListPolicyRequest struct{}" + } + + return strings.Join([]string{"ListPolicyRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_policy_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_policy_response.go new file mode 100644 index 00000000..3d5aa76b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_policy_response.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListPolicyResponse struct { + PageInfo *PagedInfo `json:"page_info,omitempty"` + + // 分页信息 + Policies *[]Policy `json:"policies,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListPolicyResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListPolicyResponse struct{}" + } + + return strings.Join([]string{"ListPolicyResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_role_names_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_role_names_request.go new file mode 100644 index 00000000..cfd74d57 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_role_names_request.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListRoleNamesRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` +} + +func (o ListRoleNamesRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListRoleNamesRequest struct{}" + } + + return strings.Join([]string{"ListRoleNamesRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_role_names_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_role_names_response.go new file mode 100644 index 00000000..4287dc8a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_role_names_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListRoleNamesResponse struct { + Body *[]string `json:"body,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListRoleNamesResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListRoleNamesResponse struct{}" + } + + return strings.Join([]string{"ListRoleNamesResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_roles_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_roles_request.go new file mode 100644 index 00000000..d6e1c796 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_roles_request.go @@ -0,0 +1,35 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListRolesRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // 模糊匹配角色名称 + RolePattern *string `json:"role_pattern,omitempty"` + + // 返回的条目数量 + Limit *int32 `json:"limit,omitempty"` + + // 查询的起始记录ID + Marker *string `json:"marker,omitempty"` + + // 是否查询上一页 + ReversePage *bool `json:"reverse_page,omitempty"` +} + +func (o ListRolesRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListRolesRequest struct{}" + } + + return strings.Join([]string{"ListRolesRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_roles_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_roles_response.go new file mode 100644 index 00000000..bbb6fbbf --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_roles_response.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListRolesResponse struct { + Roles *[]Role `json:"roles,omitempty"` + + PageInfo *PagedInfo `json:"page_info,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListRolesResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListRolesResponse struct{}" + } + + return strings.Join([]string{"ListRolesResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_specs_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_specs_request.go new file mode 100644 index 00000000..a2a5cb6c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_specs_request.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListSpecsRequest struct { + + // 规格编码 + SpecCode *string `json:"spec_code,omitempty"` + + // 偏移量 + Offset *int32 `json:"offset,omitempty"` + + // 单次查询个数 + Limit *int32 `json:"limit,omitempty"` +} + +func (o ListSpecsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListSpecsRequest struct{}" + } + + return strings.Join([]string{"ListSpecsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_specs_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_specs_response.go new file mode 100644 index 00000000..58ff69a3 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_specs_response.go @@ -0,0 +1,27 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListSpecsResponse struct { + + // 总数 + Total *int32 `json:"total,omitempty"` + + // 规格编码列表 + SpecCodes *[]Spec `json:"spec_codes,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListSpecsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListSpecsResponse struct{}" + } + + return strings.Join([]string{"ListSpecsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_by_name_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_by_name_input.go new file mode 100644 index 00000000..b5d30941 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_by_name_input.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 表列表 +type ListTableByNameInput struct { + + // 被查询表的名字列表 + TableNames []string `json:"table_names"` +} + +func (o ListTableByNameInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListTableByNameInput struct{}" + } + + return strings.Join([]string{"ListTableByNameInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_column_statistics_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_column_statistics_request.go new file mode 100644 index 00000000..38d6d4ac --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_column_statistics_request.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListTableColumnStatisticsRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + Body *GetTableColumnStatisticsInput `json:"body,omitempty"` +} + +func (o ListTableColumnStatisticsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListTableColumnStatisticsRequest struct{}" + } + + return strings.Join([]string{"ListTableColumnStatisticsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_column_statistics_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_column_statistics_response.go new file mode 100644 index 00000000..13850d3d --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_column_statistics_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListTableColumnStatisticsResponse struct { + Body *[]ColumnStatisticsObj `json:"body,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListTableColumnStatisticsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListTableColumnStatisticsResponse struct{}" + } + + return strings.Join([]string{"ListTableColumnStatisticsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_meta_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_meta_request.go new file mode 100644 index 00000000..ca5e3375 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_meta_request.go @@ -0,0 +1,97 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// Request Object +type ListTableMetaRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库通配符 + DatabaseNamePattern *string `json:"database_name_pattern,omitempty"` + + // 表名通配符 + TableNamePattern *string `json:"table_name_pattern,omitempty"` + + // 查询的表类型 + TableTypes *[]ListTableMetaRequestTableTypes `json:"table_types,omitempty"` + + // 返回的条目数量 + Limit *int32 `json:"limit,omitempty"` + + // 查询的起始记录ID + Marker *string `json:"marker,omitempty"` + + // 是否查询上一页 + ReversePage *bool `json:"reverse_page,omitempty"` +} + +func (o ListTableMetaRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListTableMetaRequest struct{}" + } + + return strings.Join([]string{"ListTableMetaRequest", string(data)}, " ") +} + +type ListTableMetaRequestTableTypes struct { + value string +} + +type ListTableMetaRequestTableTypesEnum struct { + MANAGED_TABLE ListTableMetaRequestTableTypes + EXTERNAL_TABLE ListTableMetaRequestTableTypes + VIRTUAL_VIEW ListTableMetaRequestTableTypes + MATERIALIZED_VIEW ListTableMetaRequestTableTypes +} + +func GetListTableMetaRequestTableTypesEnum() ListTableMetaRequestTableTypesEnum { + return ListTableMetaRequestTableTypesEnum{ + MANAGED_TABLE: ListTableMetaRequestTableTypes{ + value: "MANAGED_TABLE", + }, + EXTERNAL_TABLE: ListTableMetaRequestTableTypes{ + value: "EXTERNAL_TABLE", + }, + VIRTUAL_VIEW: ListTableMetaRequestTableTypes{ + value: "VIRTUAL_VIEW", + }, + MATERIALIZED_VIEW: ListTableMetaRequestTableTypes{ + value: "MATERIALIZED_VIEW", + }, + } +} + +func (c ListTableMetaRequestTableTypes) Value() string { + return c.value +} + +func (c ListTableMetaRequestTableTypes) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ListTableMetaRequestTableTypes) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_meta_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_meta_response.go new file mode 100644 index 00000000..fd54f08c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_meta_response.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListTableMetaResponse struct { + TableMetas *[]TableMeta `json:"table_metas,omitempty"` + + PageInfo *PagedInfo `json:"page_info,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListTableMetaResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListTableMetaResponse struct{}" + } + + return strings.Join([]string{"ListTableMetaResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_names_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_names_request.go new file mode 100644 index 00000000..24bc0eca --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_names_request.go @@ -0,0 +1,35 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListTableNamesRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名通配符 + TablePattern *string `json:"table_pattern,omitempty"` + + // 查询的表类型 + TableType *string `json:"table_type,omitempty"` +} + +func (o ListTableNamesRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListTableNamesRequest struct{}" + } + + return strings.Join([]string{"ListTableNamesRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_names_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_names_response.go new file mode 100644 index 00000000..4b1aae4d --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_table_names_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListTableNamesResponse struct { + Body *[]string `json:"body,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListTableNamesResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListTableNamesResponse struct{}" + } + + return strings.Join([]string{"ListTableNamesResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_by_name_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_by_name_request.go new file mode 100644 index 00000000..94c7f3bd --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_by_name_request.go @@ -0,0 +1,31 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListTablesByNameRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + Body *ListTableByNameInput `json:"body,omitempty"` +} + +func (o ListTablesByNameRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListTablesByNameRequest struct{}" + } + + return strings.Join([]string{"ListTablesByNameRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_by_name_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_by_name_response.go new file mode 100644 index 00000000..4cc002f6 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_by_name_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListTablesByNameResponse struct { + Body *[]Table `json:"body,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListTablesByNameResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListTablesByNameResponse struct{}" + } + + return strings.Join([]string{"ListTablesByNameResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_request.go new file mode 100644 index 00000000..5d665169 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_request.go @@ -0,0 +1,100 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// Request Object +type ListTablesRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名字通配符 + TableNamePattern *string `json:"table_name_pattern,omitempty"` + + // table_type + TableType *ListTablesRequestTableType `json:"table_type,omitempty"` + + // 过滤条件字符串,可以按照属性查询表。 支持的属性查找包括: HIVE_FILTER_FIELD_OWNER HIVE_FILTER_FIELD_LAST_ACCESS HIVE_FILTER_FIELD_PARAMS + Filter *string `json:"filter,omitempty"` + + // 返回的条目数量 + Limit *int32 `json:"limit,omitempty"` + + // 查询的起始记录ID + Marker *string `json:"marker,omitempty"` + + // 是否查询上一页 + ReversePage *bool `json:"reverse_page,omitempty"` +} + +func (o ListTablesRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListTablesRequest struct{}" + } + + return strings.Join([]string{"ListTablesRequest", string(data)}, " ") +} + +type ListTablesRequestTableType struct { + value string +} + +type ListTablesRequestTableTypeEnum struct { + MANAGED_TABLE ListTablesRequestTableType + EXTERNAL_TABLE ListTablesRequestTableType + VIRTUAL_VIEW ListTablesRequestTableType + MATERIALIZED_VIEW ListTablesRequestTableType +} + +func GetListTablesRequestTableTypeEnum() ListTablesRequestTableTypeEnum { + return ListTablesRequestTableTypeEnum{ + MANAGED_TABLE: ListTablesRequestTableType{ + value: "MANAGED_TABLE", + }, + EXTERNAL_TABLE: ListTablesRequestTableType{ + value: "EXTERNAL_TABLE", + }, + VIRTUAL_VIEW: ListTablesRequestTableType{ + value: "VIRTUAL_VIEW", + }, + MATERIALIZED_VIEW: ListTablesRequestTableType{ + value: "MATERIALIZED_VIEW", + }, + } +} + +func (c ListTablesRequestTableType) Value() string { + return c.value +} + +func (c ListTablesRequestTableType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ListTablesRequestTableType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_response.go new file mode 100644 index 00000000..d9b3f947 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_list_tables_response.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListTablesResponse struct { + Tables *[]Table `json:"tables,omitempty"` + + PageInfo *PagedInfo `json:"page_info,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListTablesResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListTablesResponse struct{}" + } + + return strings.Join([]string{"ListTablesResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_long_column_statistics_data.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_long_column_statistics_data.go new file mode 100644 index 00000000..c74d5fff --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_long_column_statistics_data.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type LongColumnStatisticsData struct { + + // 列中长整数最小值 + MinimumValue int64 `json:"minimum_value"` + + // 列中长整数最大值 + MaximumValue int64 `json:"maximum_value"` + + // 列中空值个数 + NumberOfNull int64 `json:"number_of_null"` + + // 列中去重后的长整数个数 + NumberOfDistinctValue int64 `json:"number_of_distinct_value"` + + // 估算唯一值使用的位图 + BitVector string `json:"bit_vector,omitempty"` +} + +func (o LongColumnStatisticsData) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "LongColumnStatisticsData struct{}" + } + + return strings.Join([]string{"LongColumnStatisticsData", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_merge_table_column_statistic_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_merge_table_column_statistic_input.go new file mode 100644 index 00000000..3d208da0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_merge_table_column_statistic_input.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type MergeTableColumnStatisticInput struct { + + // 是否是对统计信息的合并操作 + Merge *bool `json:"merge,omitempty"` + + TableColumnStatistics *TableColumnStatistics `json:"table_column_statistics"` +} + +func (o MergeTableColumnStatisticInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "MergeTableColumnStatisticInput struct{}" + } + + return strings.Join([]string{"MergeTableColumnStatisticInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_move_lake_formation_instance_out_recycle_bin_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_move_lake_formation_instance_out_recycle_bin_request.go new file mode 100644 index 00000000..5141be8b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_move_lake_formation_instance_out_recycle_bin_request.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type MoveLakeFormationInstanceOutRecycleBinRequest struct { + + // LakeFormation实例ID + InstanceId string `json:"instance_id"` +} + +func (o MoveLakeFormationInstanceOutRecycleBinRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "MoveLakeFormationInstanceOutRecycleBinRequest struct{}" + } + + return strings.Join([]string{"MoveLakeFormationInstanceOutRecycleBinRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_move_lake_formation_instance_out_recycle_bin_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_move_lake_formation_instance_out_recycle_bin_response.go new file mode 100644 index 00000000..b5305bf1 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_move_lake_formation_instance_out_recycle_bin_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type MoveLakeFormationInstanceOutRecycleBinResponse struct { + XRequestId *string `json:"X-request-id,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o MoveLakeFormationInstanceOutRecycleBinResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "MoveLakeFormationInstanceOutRecycleBinResponse struct{}" + } + + return strings.Join([]string{"MoveLakeFormationInstanceOutRecycleBinResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_not_null_constraint.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_not_null_constraint.go new file mode 100644 index 00000000..8ac3788b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_not_null_constraint.go @@ -0,0 +1,43 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type NotNullConstraint struct { + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + // 列名 + ColumnName string `json:"column_name"` + + // constraint Name + ConstraintName string `json:"constraint_name"` + + // enable constraint + EnableConstraint bool `json:"enable_constraint"` + + // constraint is rely when Query + RelyConstraint bool `json:"rely_constraint"` + + // constraint is validated + ValidateConstraint bool `json:"validate_constraint"` +} + +func (o NotNullConstraint) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "NotNullConstraint struct{}" + } + + return strings.Join([]string{"NotNullConstraint", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_not_null_constraint_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_not_null_constraint_input.go new file mode 100644 index 00000000..cd09aa31 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_not_null_constraint_input.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type NotNullConstraintInput struct { + + // 列名 + ColumnName string `json:"column_name"` + + // constraint Name + ConstraintName string `json:"constraint_name"` + + // enable constraint + EnableConstraint bool `json:"enable_constraint"` + + // constraint is rely when Query + RelyConstraint bool `json:"rely_constraint"` + + // constraint is validated + ValidateConstraint bool `json:"validate_constraint"` +} + +func (o NotNullConstraintInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "NotNullConstraintInput struct{}" + } + + return strings.Join([]string{"NotNullConstraintInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_order.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_order.go new file mode 100644 index 00000000..f79b6501 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_order.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 排列顺序 +type Order struct { + + // 列的名称 + Column *string `json:"column,omitempty"` + + // 指示是按升序 (== 1) 还是降序 (==0) 对列进行排序 + SortOrder *int32 `json:"sort_order,omitempty"` +} + +func (o Order) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Order struct{}" + } + + return strings.Join([]string{"Order", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_paged_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_paged_info.go new file mode 100644 index 00000000..0e2ebc71 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_paged_info.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 分页返回信息 +type PagedInfo struct { + + // 本次返回的对象个数 + CurrentCount int32 `json:"current_count"` + + // 下一页查询地址 + NextMarker string `json:"next_marker"` + + // 上一页查询地址 + PreviousMarker string `json:"previous_marker"` +} + +func (o PagedInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PagedInfo struct{}" + } + + return strings.Join([]string{"PagedInfo", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition.go new file mode 100644 index 00000000..0559b370 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition.go @@ -0,0 +1,44 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 分区信息 +type Partition struct { + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名字 + TableName string `json:"table_name"` + + // 分区值的列表 + PartitionValues []string `json:"partition_values"` + + // 创建时间 + CreateTime *sdktime.SdkTime `json:"create_time"` + + // 最后访问时间 + LastAccessTime *sdktime.SdkTime `json:"last_access_time"` + + // 参数表 + Parameters map[string]string `json:"parameters"` + + StorageDescriptor *StorageDescriptor `json:"storage_descriptor"` +} + +func (o Partition) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Partition struct{}" + } + + return strings.Join([]string{"Partition", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition_column_statistics.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition_column_statistics.go new file mode 100644 index 00000000..cff40dac --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition_column_statistics.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 分区中的列统计 +type PartitionColumnStatistics struct { + ColumnStatisticsDesc *PartitionColumnStatisticsDescription `json:"column_statistics_desc"` + + // 列统计信息 + ColumnStatisticsObjects []ColumnStatisticsObj `json:"column_statistics_objects"` +} + +func (o PartitionColumnStatistics) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PartitionColumnStatistics struct{}" + } + + return strings.Join([]string{"PartitionColumnStatistics", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition_column_statistics_description.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition_column_statistics_description.go new file mode 100644 index 00000000..e4a4d5fd --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition_column_statistics_description.go @@ -0,0 +1,27 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 列统计信息的描述信息 +type PartitionColumnStatisticsDescription struct { + + // 分区值的列表 + PartitionValues *[]string `json:"partition_values,omitempty"` + + // 最后统计时间 + LastAnalyzedTime *sdktime.SdkTime `json:"last_analyzed_time"` +} + +func (o PartitionColumnStatisticsDescription) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PartitionColumnStatisticsDescription struct{}" + } + + return strings.Join([]string{"PartitionColumnStatisticsDescription", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition_input.go new file mode 100644 index 00000000..b74a5f44 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_partition_input.go @@ -0,0 +1,35 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// partition base object +type PartitionInput struct { + + // 分区值列表 + PartitionValues []string `json:"partition_values"` + + // 创建时间 + CreateTime *sdktime.SdkTime `json:"create_time"` + + // 最后访问时间 + LastAccessTime *sdktime.SdkTime `json:"last_access_time"` + + // 参数信息 + Parameters map[string]string `json:"parameters"` + + StorageDescriptor *StorageDescriptor `json:"storage_descriptor"` +} + +func (o PartitionInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PartitionInput struct{}" + } + + return strings.Join([]string{"PartitionInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy.go new file mode 100644 index 00000000..ce4f4d87 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy.go @@ -0,0 +1,110 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type Policy struct { + + // 排除的允许策略 + AllowExceptions *[]PolicyItem `json:"allow_exceptions,omitempty"` + + // 条件属性 + Conditions *[]PolicyItemCondition `json:"conditions,omitempty"` + + // 创建时间 + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 创建者 + CreatedBy *string `json:"created_by,omitempty"` + + // 类掩码策略条目 + DataMaskPolicyItems *[]DataMaskPolicyItem `json:"data_mask_policy_items,omitempty"` + + // 拒绝排除策略 + DenyExceptions *[]PolicyItem `json:"deny_exceptions,omitempty"` + + // 拒绝策略 + DenyPolicyItems *[]PolicyItem `json:"deny_policy_items,omitempty"` + + // 描述 + Description *string `json:"description,omitempty"` + + // 唯一guid + Guid *string `json:"guid,omitempty"` + + // 主键 + Id *int64 `json:"id,omitempty"` + + // 是否支持审计 + IsAuditEnabled *bool `json:"is_audit_enabled,omitempty"` + + // 是否默认策略 + IsDefaultPolicy *bool `json:"is_default_policy,omitempty"` + + // 是否拒绝所有 + IsDenyAllElse *bool `json:"is_deny_all_else,omitempty"` + + // 是否启动 + IsEnabled *bool `json:"is_enabled,omitempty"` + + // 名 + Name *string `json:"name,omitempty"` + + // 选项 + Options *interface{} `json:"options,omitempty"` + + // 策略信息数组 + PolicyItems *[]PolicyItem `json:"policy_items,omitempty"` + + // 策略便签 + PolicyLabels *[]string `json:"policy_labels,omitempty"` + + // 策略优先级 + PolicyPriority *int32 `json:"policy_priority,omitempty"` + + // 策略类型 + PolicyType *int32 `json:"policy_type,omitempty"` + + // 资源签名 + ResourceSignature *string `json:"resource_signature,omitempty"` + + // 资源 + Resources map[string]PolicyResource `json:"resources,omitempty"` + + // 行过滤策略条目 + RowFilterPolicyItems *[]RowFilterPolicyItem `json:"row_filter_policy_items,omitempty"` + + // 服务 + Service *string `json:"service,omitempty"` + + // 服务类型 + ServiceType *string `json:"service_type,omitempty"` + + // 更新时间 + UpdateTime *sdktime.SdkTime `json:"update_time,omitempty"` + + // 更新者 + UpdatedBy *string `json:"updated_by,omitempty"` + + // 验证周期 + ValiditySchedules *[]ValiditySchedule `json:"validity_schedules,omitempty"` + + // 版本 + Version *int64 `json:"version,omitempty"` + + // 域 + ZoneName *string `json:"zone_name,omitempty"` +} + +func (o Policy) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Policy struct{}" + } + + return strings.Join([]string{"Policy", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_delta.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_delta.go new file mode 100644 index 00000000..caa84c51 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_delta.go @@ -0,0 +1,20 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type PolicyDelta struct { + Policy *Policy `json:"policy,omitempty"` +} + +func (o PolicyDelta) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PolicyDelta struct{}" + } + + return strings.Join([]string{"PolicyDelta", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item.go new file mode 100644 index 00000000..9d59ab4f --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item.go @@ -0,0 +1,37 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type PolicyItem struct { + + // 访问控制数据 + Accesses *[]PolicyItemAccess `json:"accesses,omitempty"` + + // 条件 + Conditions *[]PolicyItemCondition `json:"conditions,omitempty"` + + // 是否传递 + DelegateAdmin *bool `json:"delegate_admin,omitempty"` + + // 组 + Groups *[]string `json:"groups,omitempty"` + + // 角色 + Roles *[]string `json:"roles,omitempty"` + + // 用户 + Users *[]string `json:"users,omitempty"` +} + +func (o PolicyItem) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PolicyItem struct{}" + } + + return strings.Join([]string{"PolicyItem", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_access.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_access.go new file mode 100644 index 00000000..de22d504 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_access.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type PolicyItemAccess struct { + + // 是否允许 + IsAllowed *bool `json:"is_allowed,omitempty"` + + // 类型 + Type *string `json:"type,omitempty"` +} + +func (o PolicyItemAccess) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PolicyItemAccess struct{}" + } + + return strings.Join([]string{"PolicyItemAccess", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_condition.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_condition.go new file mode 100644 index 00000000..6bbc11c2 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_condition.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type PolicyItemCondition struct { + + // 条件类型 + Type *string `json:"type,omitempty"` + + // 条件值 + Values *[]string `json:"values,omitempty"` +} + +func (o PolicyItemCondition) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PolicyItemCondition struct{}" + } + + return strings.Join([]string{"PolicyItemCondition", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_data_mask_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_data_mask_info.go new file mode 100644 index 00000000..18f676ff --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_data_mask_info.go @@ -0,0 +1,28 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type PolicyItemDataMaskInfo struct { + + // 条件表达式 + ConditionExpr *string `json:"condition_expr,omitempty"` + + // 列掩码类型 + DataMaskType *string `json:"data_mask_type,omitempty"` + + // 列掩码表达式 + ValueExpr *string `json:"value_expr,omitempty"` +} + +func (o PolicyItemDataMaskInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PolicyItemDataMaskInfo struct{}" + } + + return strings.Join([]string{"PolicyItemDataMaskInfo", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_row_filter_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_row_filter_info.go new file mode 100644 index 00000000..f70fa6fa --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_item_row_filter_info.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type PolicyItemRowFilterInfo struct { + + // 行过滤表达式 + FilterExpr *string `json:"filter_expr,omitempty"` +} + +func (o PolicyItemRowFilterInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PolicyItemRowFilterInfo struct{}" + } + + return strings.Join([]string{"PolicyItemRowFilterInfo", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_resource.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_resource.go new file mode 100644 index 00000000..8f510df5 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_policy_resource.go @@ -0,0 +1,28 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type PolicyResource struct { + + // 是否排除 + IsExcludes *bool `json:"is_excludes,omitempty"` + + // 是否递归 + IsRecursive *bool `json:"is_recursive,omitempty"` + + // 值 + Values *[]string `json:"values,omitempty"` +} + +func (o PolicyResource) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PolicyResource struct{}" + } + + return strings.Join([]string{"PolicyResource", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_primary_key.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_primary_key.go new file mode 100644 index 00000000..125c03ff --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_primary_key.go @@ -0,0 +1,47 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 主键信息 +type PrimaryKey struct { + + // catalog名称 + CatalogName string `json:"catalog_name"` + + // 列名称 + ColumnName string `json:"column_name"` + + // 数据库名称 + DatabaseName string `json:"database_name"` + + // 表名字 + TableName string `json:"table_name"` + + // 主键名称 + PrimaryKeyName string `json:"primary_key_name"` + + // 是否启用主键 + EnableConstraint bool `json:"enable_constraint"` + + // 主键排序顺序 + KeySequence *int32 `json:"key_sequence,omitempty"` + + // 是否被外键依赖 + RelyConstraint bool `json:"rely_constraint"` + + // 限制条件是否可用 + ValidateConstraint bool `json:"validate_constraint"` +} + +func (o PrimaryKey) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PrimaryKey struct{}" + } + + return strings.Join([]string{"PrimaryKey", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_primary_key_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_primary_key_input.go new file mode 100644 index 00000000..00140bda --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_primary_key_input.go @@ -0,0 +1,38 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 主键信息 +type PrimaryKeyInput struct { + + // 列名称 + ColumnName string `json:"column_name"` + + // 主键名称 + PrimaryKeyName string `json:"primary_key_name"` + + // 是否启用主键 + EnableConstraint bool `json:"enable_constraint"` + + // 主键排序顺序 + KeySequence *int32 `json:"key_sequence,omitempty"` + + // 是否被外键依赖 + RelyConstraint bool `json:"rely_constraint"` + + // 限制条件是否可用 + ValidateConstraint bool `json:"validate_constraint"` +} + +func (o PrimaryKeyInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "PrimaryKeyInput struct{}" + } + + return strings.Join([]string{"PrimaryKeyInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_principal.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_principal.go new file mode 100644 index 00000000..c195b43c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_principal.go @@ -0,0 +1,135 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type Principal struct { + + // 主体类型 USER用户 GROUP组 ROLE角色 SHARE共享 OTHER其它 + PrincipalType PrincipalPrincipalType `json:"principal_type"` + + // 主体来源 IAM云用户 SAML联邦 LDAP ld用户 LOCAL 本地用户 + PrincipalSource PrincipalPrincipalSource `json:"principal_source"` + + // 主体名 + PrincipalName string `json:"principal_name"` +} + +func (o Principal) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Principal struct{}" + } + + return strings.Join([]string{"Principal", string(data)}, " ") +} + +type PrincipalPrincipalType struct { + value string +} + +type PrincipalPrincipalTypeEnum struct { + USER PrincipalPrincipalType + GROUP PrincipalPrincipalType + ROLE PrincipalPrincipalType + SHARE PrincipalPrincipalType + OTHER PrincipalPrincipalType +} + +func GetPrincipalPrincipalTypeEnum() PrincipalPrincipalTypeEnum { + return PrincipalPrincipalTypeEnum{ + USER: PrincipalPrincipalType{ + value: "USER", + }, + GROUP: PrincipalPrincipalType{ + value: "GROUP", + }, + ROLE: PrincipalPrincipalType{ + value: "ROLE", + }, + SHARE: PrincipalPrincipalType{ + value: "SHARE", + }, + OTHER: PrincipalPrincipalType{ + value: "OTHER", + }, + } +} + +func (c PrincipalPrincipalType) Value() string { + return c.value +} + +func (c PrincipalPrincipalType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *PrincipalPrincipalType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type PrincipalPrincipalSource struct { + value string +} + +type PrincipalPrincipalSourceEnum struct { + IAM PrincipalPrincipalSource + SAML PrincipalPrincipalSource + LDAP PrincipalPrincipalSource + LOCAL PrincipalPrincipalSource +} + +func GetPrincipalPrincipalSourceEnum() PrincipalPrincipalSourceEnum { + return PrincipalPrincipalSourceEnum{ + IAM: PrincipalPrincipalSource{ + value: "IAM", + }, + SAML: PrincipalPrincipalSource{ + value: "SAML", + }, + LDAP: PrincipalPrincipalSource{ + value: "LDAP", + }, + LOCAL: PrincipalPrincipalSource{ + value: "LOCAL", + }, + } +} + +func (c PrincipalPrincipalSource) Value() string { + return c.value +} + +func (c PrincipalPrincipalSource) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *PrincipalPrincipalSource) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_recurrence_schedule.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_recurrence_schedule.go new file mode 100644 index 00000000..458fc5d3 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_recurrence_schedule.go @@ -0,0 +1,37 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type RecurrenceSchedule struct { + + // 日期按月 + DayOfMonth *string `json:"day_of_month,omitempty"` + + // 日期按星期 + DayOfWeek *string `json:"day_of_week,omitempty"` + + // 时 + Hour *string `json:"hour,omitempty"` + + // 分 + Minute *string `json:"minute,omitempty"` + + // 月 + Month *string `json:"month,omitempty"` + + // 年 + Year *string `json:"year,omitempty"` +} + +func (o RecurrenceSchedule) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "RecurrenceSchedule struct{}" + } + + return strings.Join([]string{"RecurrenceSchedule", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_resource_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_resource_info.go new file mode 100644 index 00000000..07bb8537 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_resource_info.go @@ -0,0 +1,94 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// catalog input when grant policy +type ResourceInfo struct { + + // catalog info + Catalogs *[]CatalogInfo `json:"catalogs,omitempty"` + + // uri + Uris *[]string `json:"uris,omitempty"` + + // resource type + Type ResourceInfoType `json:"type"` +} + +func (o ResourceInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ResourceInfo struct{}" + } + + return strings.Join([]string{"ResourceInfo", string(data)}, " ") +} + +type ResourceInfoType struct { + value string +} + +type ResourceInfoTypeEnum struct { + CATALOG ResourceInfoType + DATABASE ResourceInfoType + TABLE ResourceInfoType + COLUMN ResourceInfoType + FUNC ResourceInfoType + MODEL ResourceInfoType + URI ResourceInfoType +} + +func GetResourceInfoTypeEnum() ResourceInfoTypeEnum { + return ResourceInfoTypeEnum{ + CATALOG: ResourceInfoType{ + value: "CATALOG", + }, + DATABASE: ResourceInfoType{ + value: "DATABASE", + }, + TABLE: ResourceInfoType{ + value: "TABLE", + }, + COLUMN: ResourceInfoType{ + value: "COLUMN", + }, + FUNC: ResourceInfoType{ + value: "FUNC", + }, + MODEL: ResourceInfoType{ + value: "MODEL", + }, + URI: ResourceInfoType{ + value: "URI", + }, + } +} + +func (c ResourceInfoType) Value() string { + return c.value +} + +func (c ResourceInfoType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ResourceInfoType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_resource_tag.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_resource_tag.go new file mode 100644 index 00000000..79f01d9a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_resource_tag.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 标签 +type ResourceTag struct { + + // 键 + Key string `json:"key"` + + // 值 + Value *string `json:"value,omitempty"` +} + +func (o ResourceTag) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ResourceTag struct{}" + } + + return strings.Join([]string{"ResourceTag", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_role.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_role.go new file mode 100644 index 00000000..630013af --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_role.go @@ -0,0 +1,86 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// role 响应 +type Role struct { + + // role名字 + RoleName string `json:"role_name"` + + // 描述信息 + Description *string `json:"description,omitempty"` + + // 主体来源 IAM云用户 SAML联邦 LDAP ld用户 LOCAL 本地用户 OTHER 其它 + PrincipalSource RolePrincipalSource `json:"principal_source"` +} + +func (o Role) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Role struct{}" + } + + return strings.Join([]string{"Role", string(data)}, " ") +} + +type RolePrincipalSource struct { + value string +} + +type RolePrincipalSourceEnum struct { + IAM RolePrincipalSource + SAML RolePrincipalSource + LDAP RolePrincipalSource + LOCAL RolePrincipalSource + OTHER RolePrincipalSource +} + +func GetRolePrincipalSourceEnum() RolePrincipalSourceEnum { + return RolePrincipalSourceEnum{ + IAM: RolePrincipalSource{ + value: "IAM", + }, + SAML: RolePrincipalSource{ + value: "SAML", + }, + LDAP: RolePrincipalSource{ + value: "LDAP", + }, + LOCAL: RolePrincipalSource{ + value: "LOCAL", + }, + OTHER: RolePrincipalSource{ + value: "OTHER", + }, + } +} + +func (c RolePrincipalSource) Value() string { + return c.value +} + +func (c RolePrincipalSource) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *RolePrincipalSource) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_role_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_role_input.go new file mode 100644 index 00000000..01e0b145 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_role_input.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// role信息 +type RoleInput struct { + + // role名字 + RoleName string `json:"role_name"` + + // 描述信息 + Description *string `json:"description,omitempty"` +} + +func (o RoleInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "RoleInput struct{}" + } + + return strings.Join([]string{"RoleInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_row_filter_policy_item.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_row_filter_policy_item.go new file mode 100644 index 00000000..89be9044 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_row_filter_policy_item.go @@ -0,0 +1,39 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type RowFilterPolicyItem struct { + + // 权限 + Accesses *[]PolicyItemAccess `json:"accesses,omitempty"` + + // 条件 + Conditions *[]PolicyItemCondition `json:"conditions,omitempty"` + + // 是否传递 + DelegateAdmin *bool `json:"delegate_admin,omitempty"` + + // 组 + Groups *[]string `json:"groups,omitempty"` + + // 角色 + Roles *[]string `json:"roles,omitempty"` + + RowFilterInfo *PolicyItemRowFilterInfo `json:"row_filter_info,omitempty"` + + // 用户 + Users *[]string `json:"users,omitempty"` +} + +func (o RowFilterPolicyItem) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "RowFilterPolicyItem struct{}" + } + + return strings.Join([]string{"RowFilterPolicyItem", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_ser_de_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_ser_de_info.go new file mode 100644 index 00000000..d86524e6 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_ser_de_info.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 序列化/反序列化的信息 +type SerDeInfo struct { + + // 名字信息 + Name *string `json:"name,omitempty"` + + // 实现序列化/反序列化的类 + SerializationLibrary *string `json:"serialization_library,omitempty"` + + // 参数数组。 key最小值1,最大值255 value最大值4000 + Parameters map[string]string `json:"parameters,omitempty"` +} + +func (o SerDeInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "SerDeInfo struct{}" + } + + return strings.Join([]string{"SerDeInfo", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_partition_column_statistics_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_partition_column_statistics_input.go new file mode 100644 index 00000000..fee327ed --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_partition_column_statistics_input.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 设置分区的列统计信息body体 +type SetPartitionColumnStatisticsInput struct { + + // 是否合入原有统计信息 + NeedMerge bool `json:"need_merge"` + + // 分区统计信息的统计列表 + Statistics []PartitionColumnStatistics `json:"statistics"` +} + +func (o SetPartitionColumnStatisticsInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "SetPartitionColumnStatisticsInput struct{}" + } + + return strings.Join([]string{"SetPartitionColumnStatisticsInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_partition_column_statistics_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_partition_column_statistics_request.go new file mode 100644 index 00000000..efca8d8a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_partition_column_statistics_request.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type SetPartitionColumnStatisticsRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + Body *SetPartitionColumnStatisticsInput `json:"body,omitempty"` +} + +func (o SetPartitionColumnStatisticsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "SetPartitionColumnStatisticsRequest struct{}" + } + + return strings.Join([]string{"SetPartitionColumnStatisticsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_partition_column_statistics_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_partition_column_statistics_response.go new file mode 100644 index 00000000..38d8346f --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_partition_column_statistics_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type SetPartitionColumnStatisticsResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o SetPartitionColumnStatisticsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "SetPartitionColumnStatisticsResponse struct{}" + } + + return strings.Join([]string{"SetPartitionColumnStatisticsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_table_column_statistics_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_table_column_statistics_request.go new file mode 100644 index 00000000..8d8c02cc --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_table_column_statistics_request.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type SetTableColumnStatisticsRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + Body *MergeTableColumnStatisticInput `json:"body,omitempty"` +} + +func (o SetTableColumnStatisticsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "SetTableColumnStatisticsRequest struct{}" + } + + return strings.Join([]string{"SetTableColumnStatisticsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_table_column_statistics_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_table_column_statistics_response.go new file mode 100644 index 00000000..d1801232 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_set_table_column_statistics_response.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type SetTableColumnStatisticsResponse struct { + ColumnStatisticsDesc *TableColumnStatisticsDescription `json:"column_statistics_desc,omitempty"` + + // 列统计信息 + ColumnStatisticsObjects *[]ColumnStatisticsObj `json:"column_statistics_objects,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o SetTableColumnStatisticsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "SetTableColumnStatisticsResponse struct{}" + } + + return strings.Join([]string{"SetTableColumnStatisticsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_request.go new file mode 100644 index 00000000..1c435899 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_request.go @@ -0,0 +1,20 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ShowAgreementRequest struct { +} + +func (o ShowAgreementRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowAgreementRequest struct{}" + } + + return strings.Join([]string{"ShowAgreementRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_response.go new file mode 100644 index 00000000..4a3f1127 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_response.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ShowAgreementResponse struct { + + // 租户协议列表 + Agreements *[]TenantAgreement `json:"agreements,omitempty"` + + // 是否绑定了委托 + IsAgency *bool `json:"is_agency,omitempty"` + + XRequestId *string `json:"X-request-id,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ShowAgreementResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowAgreementResponse struct{}" + } + + return strings.Join([]string{"ShowAgreementResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_rule_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_rule_request.go new file mode 100644 index 00000000..797a510b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_rule_request.go @@ -0,0 +1,20 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ShowAgreementRuleRequest struct { +} + +func (o ShowAgreementRuleRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowAgreementRuleRequest struct{}" + } + + return strings.Join([]string{"ShowAgreementRuleRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_rule_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_rule_response.go new file mode 100644 index 00000000..0315683b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_agreement_rule_response.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ShowAgreementRuleResponse struct { + + // 系统协议列表 + AgreementRules *[]AgreementRule `json:"agreement_rules,omitempty"` + + XRequestId *string `json:"X-request-id,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ShowAgreementRuleResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowAgreementRuleResponse struct{}" + } + + return strings.Join([]string{"ShowAgreementRuleResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_catalog_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_catalog_request.go new file mode 100644 index 00000000..4ac1b099 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_catalog_request.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ShowCatalogRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // 被查询的catalog名字 + CatalogName string `json:"catalog_name"` +} + +func (o ShowCatalogRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowCatalogRequest struct{}" + } + + return strings.Join([]string{"ShowCatalogRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_catalog_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_catalog_response.go new file mode 100644 index 00000000..3dcca26a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_catalog_response.go @@ -0,0 +1,33 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ShowCatalogResponse struct { + + // catalog名字 + CatalogName *string `json:"catalog_name,omitempty"` + + // 描述信息 + Description *string `json:"description,omitempty"` + + // 路径地址 + Location *string `json:"location,omitempty"` + + // database路径列表 + DatabaseLocationList *[]string `json:"database_location_list,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ShowCatalogResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowCatalogResponse struct{}" + } + + return strings.Join([]string{"ShowCatalogResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_database_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_database_request.go new file mode 100644 index 00000000..d02bc7f1 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_database_request.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ShowDatabaseRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` +} + +func (o ShowDatabaseRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowDatabaseRequest struct{}" + } + + return strings.Join([]string{"ShowDatabaseRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_database_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_database_response.go new file mode 100644 index 00000000..b5ce70b4 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_database_response.go @@ -0,0 +1,97 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// Response Object +type ShowDatabaseResponse struct { + + // catalog名字 + CatalogName *string `json:"catalog_name,omitempty"` + + // 数据库名 + DatabaseName *string `json:"database_name,omitempty"` + + // 数据库所有者 + Owner *string `json:"owner,omitempty"` + + // 所有者类型 + OwnerType *ShowDatabaseResponseOwnerType `json:"owner_type,omitempty"` + + // 数据库描述信息 + Description *string `json:"description,omitempty"` + + // 数据库路径地址 + Location *string `json:"location,omitempty"` + + // 参数信息 + Parameters map[string]string `json:"parameters,omitempty"` + + // 表路径列表 + TableLocationList *[]string `json:"table_location_list,omitempty"` + + // 函数路径列表 + FunctionLocationList *[]string `json:"function_location_list,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ShowDatabaseResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowDatabaseResponse struct{}" + } + + return strings.Join([]string{"ShowDatabaseResponse", string(data)}, " ") +} + +type ShowDatabaseResponseOwnerType struct { + value string +} + +type ShowDatabaseResponseOwnerTypeEnum struct { + USER ShowDatabaseResponseOwnerType + GROUP ShowDatabaseResponseOwnerType + ROLE ShowDatabaseResponseOwnerType +} + +func GetShowDatabaseResponseOwnerTypeEnum() ShowDatabaseResponseOwnerTypeEnum { + return ShowDatabaseResponseOwnerTypeEnum{ + USER: ShowDatabaseResponseOwnerType{ + value: "USER", + }, + GROUP: ShowDatabaseResponseOwnerType{ + value: "GROUP", + }, + ROLE: ShowDatabaseResponseOwnerType{ + value: "ROLE", + }, + } +} + +func (c ShowDatabaseResponseOwnerType) Value() string { + return c.value +} + +func (c ShowDatabaseResponseOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ShowDatabaseResponseOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_function_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_function_request.go new file mode 100644 index 00000000..61193214 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_function_request.go @@ -0,0 +1,32 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ShowFunctionRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 函数名字 + FunctionName string `json:"function_name"` +} + +func (o ShowFunctionRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowFunctionRequest struct{}" + } + + return strings.Join([]string{"ShowFunctionRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_function_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_function_response.go new file mode 100644 index 00000000..6720b572 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_function_response.go @@ -0,0 +1,134 @@ +package model + +import ( + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + "strings" +) + +// Response Object +type ShowFunctionResponse struct { + + // catalog名字 + CatalogName *string `json:"catalog_name,omitempty"` + + // 数据库名字 + DatabaseName *string `json:"database_name,omitempty"` + + // 函数名 + FunctionName *string `json:"function_name,omitempty"` + + // 函数类型 + FunctionType *ShowFunctionResponseFunctionType `json:"function_type,omitempty"` + + // 函数所有者 + Owner *string `json:"owner,omitempty"` + + // 所有者类型 + OwnerType *ShowFunctionResponseOwnerType `json:"owner_type,omitempty"` + + // 函数类名 + ClassName *string `json:"class_name,omitempty"` + + // 创建时间格式为yyyy-mm-ddThh:mm:sss + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 函数地址信息 + ResourceUris *[]FunctionResourceUri `json:"resource_uris,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ShowFunctionResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowFunctionResponse struct{}" + } + + return strings.Join([]string{"ShowFunctionResponse", string(data)}, " ") +} + +type ShowFunctionResponseFunctionType struct { + value string +} + +type ShowFunctionResponseFunctionTypeEnum struct { + JAVA ShowFunctionResponseFunctionType +} + +func GetShowFunctionResponseFunctionTypeEnum() ShowFunctionResponseFunctionTypeEnum { + return ShowFunctionResponseFunctionTypeEnum{ + JAVA: ShowFunctionResponseFunctionType{ + value: "JAVA", + }, + } +} + +func (c ShowFunctionResponseFunctionType) Value() string { + return c.value +} + +func (c ShowFunctionResponseFunctionType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ShowFunctionResponseFunctionType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type ShowFunctionResponseOwnerType struct { + value string +} + +type ShowFunctionResponseOwnerTypeEnum struct { + USER ShowFunctionResponseOwnerType + GROUP ShowFunctionResponseOwnerType + ROLE ShowFunctionResponseOwnerType +} + +func GetShowFunctionResponseOwnerTypeEnum() ShowFunctionResponseOwnerTypeEnum { + return ShowFunctionResponseOwnerTypeEnum{ + USER: ShowFunctionResponseOwnerType{ + value: "USER", + }, + GROUP: ShowFunctionResponseOwnerType{ + value: "GROUP", + }, + ROLE: ShowFunctionResponseOwnerType{ + value: "ROLE", + }, + } +} + +func (c ShowFunctionResponseOwnerType) Value() string { + return c.value +} + +func (c ShowFunctionResponseOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ShowFunctionResponseOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_lake_formation_instance_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_lake_formation_instance_request.go new file mode 100644 index 00000000..cbbb4b18 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_lake_formation_instance_request.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ShowLakeFormationInstanceRequest struct { + + // LakeFormation实例ID + InstanceId string `json:"instance_id"` +} + +func (o ShowLakeFormationInstanceRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowLakeFormationInstanceRequest struct{}" + } + + return strings.Join([]string{"ShowLakeFormationInstanceRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_lake_formation_instance_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_lake_formation_instance_response.go new file mode 100644 index 00000000..c2a7395e --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_lake_formation_instance_response.go @@ -0,0 +1,57 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ShowLakeFormationInstanceResponse struct { + + // LakeFormation实例Id + InstanceId *string `json:"instance_id,omitempty"` + + // 实例名 + Name *string `json:"name,omitempty"` + + // 描述 + Description *string `json:"description,omitempty"` + + // 企业项目Id + EnterpriseProjectId *string `json:"enterprise_project_id,omitempty"` + + // 逻辑多租和物理多租的判断 + Shared *bool `json:"shared,omitempty"` + + // 实例创建时间戳 + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 实例更新时间戳 + UpdateTime *sdktime.SdkTime `json:"update_time,omitempty"` + + // 实例状态 + Status *string `json:"status,omitempty"` + + // 是否在回收站 + InRecycleBin *bool `json:"in_recycle_bin,omitempty"` + + // 标签列表 + Tags *[]ResourceTag `json:"tags,omitempty"` + + // 规格信息 + Specs *[]CreateSpec `json:"specs,omitempty"` + + XRequestId *string `json:"X-request-id,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ShowLakeFormationInstanceResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowLakeFormationInstanceResponse struct{}" + } + + return strings.Join([]string{"ShowLakeFormationInstanceResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_role_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_role_request.go new file mode 100644 index 00000000..b4a0eeb1 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_role_request.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ShowRoleRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // 角色名称 + RoleName string `json:"role_name"` +} + +func (o ShowRoleRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowRoleRequest struct{}" + } + + return strings.Join([]string{"ShowRoleRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_role_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_role_response.go new file mode 100644 index 00000000..19fc9c24 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_role_response.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ShowRoleResponse struct { + Role *Role `json:"role,omitempty"` + + // 角色包含的用户或者用户组信息 + UserRoles *[]UserRole `json:"user_roles,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ShowRoleResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowRoleResponse struct{}" + } + + return strings.Join([]string{"ShowRoleResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_sync_policy_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_sync_policy_request.go new file mode 100644 index 00000000..58d30fc0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_sync_policy_request.go @@ -0,0 +1,32 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ShowSyncPolicyRequest struct { + + // instance id + InstanceId string `json:"instance_id"` + + // lastKnownVersion + LastKnownVersion *int64 `json:"last_known_version,omitempty"` + + // supportsPolicyDeltas + SupportsPolicyDeltas *bool `json:"supports_policy_deltas,omitempty"` + + // isReturnPolicyData + IsReturnPolicyData *bool `json:"is_return_policy_data,omitempty"` +} + +func (o ShowSyncPolicyRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowSyncPolicyRequest struct{}" + } + + return strings.Join([]string{"ShowSyncPolicyRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_sync_policy_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_sync_policy_response.go new file mode 100644 index 00000000..c424108f --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_sync_policy_response.go @@ -0,0 +1,33 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ShowSyncPolicyResponse struct { + + // 策略版本 + PolicyVersion *int64 `json:"policy_version,omitempty"` + + // 策略更新时间 + PolicyUpdateTime *string `json:"policy_updateTime,omitempty"` + + // 权限策略信息 + Policies *[]Policy `json:"policies,omitempty"` + + // 增量权限策略信息 + PolicyDeltas *[]PolicyDelta `json:"policy_deltas,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ShowSyncPolicyResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowSyncPolicyResponse struct{}" + } + + return strings.Join([]string{"ShowSyncPolicyResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_table_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_table_request.go new file mode 100644 index 00000000..751f0f60 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_table_request.go @@ -0,0 +1,32 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ShowTableRequest struct { + + // 实例ID + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` +} + +func (o ShowTableRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowTableRequest struct{}" + } + + return strings.Join([]string{"ShowTableRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_table_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_table_response.go new file mode 100644 index 00000000..990e3941 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_show_table_response.go @@ -0,0 +1,169 @@ +package model + +import ( + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + "strings" +) + +// Response Object +type ShowTableResponse struct { + + // catalog名字 + CatalogName *string `json:"catalog_name,omitempty"` + + // 数据库名字 + DatabaseName *string `json:"database_name,omitempty"` + + // 表名字 + TableName *string `json:"table_name,omitempty"` + + // 表创建时间 + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 最后访问时间 + LastAccessTime *sdktime.SdkTime `json:"last_access_time,omitempty"` + + // 表元数据最后一次修改时间 + UpdateTime *sdktime.SdkTime `json:"update_time,omitempty"` + + // 上一次做列级别的统计信息计算的时间 + LastAnalyzedTime *sdktime.SdkTime `json:"last_analyzed_time,omitempty"` + + // 用户信息 + Owner *string `json:"owner,omitempty"` + + // 用户类型 + OwnerType *ShowTableResponseOwnerType `json:"owner_type,omitempty"` + + // 参数 + Parameters map[string]string `json:"parameters,omitempty"` + + // 表分区列的列表 + PartitionKeys *[]Column `json:"partition_keys,omitempty"` + + // 表保留时间 + Retention *int32 `json:"retention,omitempty"` + + StorageDescriptor *StorageDescriptor `json:"storage_descriptor,omitempty"` + + // 表类型 + TableType *ShowTableResponseTableType `json:"table_type,omitempty"` + + // 表描述信息 + Comments *string `json:"comments,omitempty"` + + // 如果表是视图,则为视图的扩展文本;否则为 null + ViewExpandedText *string `json:"view_expanded_text,omitempty"` + + // 如果表是视图,则为视图的原始文本;否则为 null + ViewOriginalText *string `json:"view_original_text,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ShowTableResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowTableResponse struct{}" + } + + return strings.Join([]string{"ShowTableResponse", string(data)}, " ") +} + +type ShowTableResponseOwnerType struct { + value string +} + +type ShowTableResponseOwnerTypeEnum struct { + USER ShowTableResponseOwnerType + GROUP ShowTableResponseOwnerType + ROLE ShowTableResponseOwnerType +} + +func GetShowTableResponseOwnerTypeEnum() ShowTableResponseOwnerTypeEnum { + return ShowTableResponseOwnerTypeEnum{ + USER: ShowTableResponseOwnerType{ + value: "USER", + }, + GROUP: ShowTableResponseOwnerType{ + value: "GROUP", + }, + ROLE: ShowTableResponseOwnerType{ + value: "ROLE", + }, + } +} + +func (c ShowTableResponseOwnerType) Value() string { + return c.value +} + +func (c ShowTableResponseOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ShowTableResponseOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type ShowTableResponseTableType struct { + value string +} + +type ShowTableResponseTableTypeEnum struct { + MANAGED_TABLE ShowTableResponseTableType + EXTERNAL_TABLE ShowTableResponseTableType + VIRTUAL_VIEW ShowTableResponseTableType + MATERIALIZED_VIEW ShowTableResponseTableType +} + +func GetShowTableResponseTableTypeEnum() ShowTableResponseTableTypeEnum { + return ShowTableResponseTableTypeEnum{ + MANAGED_TABLE: ShowTableResponseTableType{ + value: "MANAGED_TABLE", + }, + EXTERNAL_TABLE: ShowTableResponseTableType{ + value: "EXTERNAL_TABLE", + }, + VIRTUAL_VIEW: ShowTableResponseTableType{ + value: "VIRTUAL_VIEW", + }, + MATERIALIZED_VIEW: ShowTableResponseTableType{ + value: "MATERIALIZED_VIEW", + }, + } +} + +func (c ShowTableResponseTableType) Value() string { + return c.value +} + +func (c ShowTableResponseTableType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ShowTableResponseTableType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_skewed_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_skewed_info.go new file mode 100644 index 00000000..2b216dd9 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_skewed_info.go @@ -0,0 +1,28 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type SkewedInfo struct { + + // 数据偏移列的列表 + SkewedColumnNames []string `json:"skewed_column_names"` + + // 偏斜值和地址的映射关系. + SkewedColumnValueLocationMaps map[string]string `json:"skewed_column_value_location_maps"` + + // 偏斜值的列表. + SkewedColumnValues [][]string `json:"skewed_column_values"` +} + +func (o SkewedInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "SkewedInfo struct{}" + } + + return strings.Join([]string{"SkewedInfo", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_spec.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_spec.go new file mode 100644 index 00000000..17b5018a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_spec.go @@ -0,0 +1,47 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 规格信息 +type Spec struct { + + // 规格编码 + SpecCode *string `json:"spec_code,omitempty"` + + // 资源编码 + ResourceType *string `json:"resource_type,omitempty"` + + // 步长 + Stride *int32 `json:"stride,omitempty"` + + // 单位 + Unit *string `json:"unit,omitempty"` + + // 最小步数 + MinStrideNum *int32 `json:"min_stride_num,omitempty"` + + // 最大步数 + MaxStrideNum *int32 `json:"max_stride_num,omitempty"` + + // 使用量单位标识 + UsageMeasureId *int32 `json:"usage_measure_id,omitempty"` + + // 使用量因子 + UsageFactor *string `json:"usage_factor,omitempty"` + + // 步数白名单,返回时,步数必须是白名单中的值 + StrideNumWhitelist *[]int32 `json:"stride_num_whitelist,omitempty"` +} + +func (o Spec) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Spec struct{}" + } + + return strings.Join([]string{"Spec", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_storage_descriptor.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_storage_descriptor.go new file mode 100644 index 00000000..753b3e1a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_storage_descriptor.go @@ -0,0 +1,53 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type StorageDescriptor struct { + + // 分区列以外的所有字段 + Columns []Column `json:"columns"` + + // 存储路径 + Location *string `json:"location,omitempty"` + + // 是否启用数据压缩 + Compressed bool `json:"compressed"` + + // 输入格式 + InputFormat *string `json:"input_format,omitempty"` + + // 输出格式 + OutputFormat *string `json:"output_format,omitempty"` + + // 分桶的桶数量 + NumberOfBuckets *int32 `json:"number_of_buckets,omitempty"` + + // 分桶字段 + BucketColumns *[]string `json:"bucket_columns,omitempty"` + + // 指定表中的每个存储桶的排序顺序的列表 + SortColumns *[]Order `json:"sort_columns,omitempty"` + + SerdeInfo *SerDeInfo `json:"serde_info"` + + // 存储描述符的参数。 key最小长度为1,最大长度为255. value最大长度为4000 + Parameters map[string]string `json:"parameters"` + + SkewedInfo *SkewedInfo `json:"skewed_info,omitempty"` + + // 数据是否会存放在子目录中 + StoredAsSubDirectories *bool `json:"stored_as_sub_directories,omitempty"` +} + +func (o StorageDescriptor) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "StorageDescriptor struct{}" + } + + return strings.Join([]string{"StorageDescriptor", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_string_column_statistics_data.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_string_column_statistics_data.go new file mode 100644 index 00000000..c50908e0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_string_column_statistics_data.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type StringColumnStatisticsData struct { + + // 列中字符串平均长度 + AverageLength float64 `json:"average_length"` + + // 列中字符串最长长度 + MaximumLength int64 `json:"maximum_length"` + + // 列中空值个数 + NumberOfNull int64 `json:"number_of_null"` + + // 列中去重后字符串个数 + NumberOfDistinctValue int64 `json:"number_of_distinct_value"` + + // 估算唯一值使用的位图 + BitVector string `json:"bit_vector,omitempty"` +} + +func (o StringColumnStatisticsData) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "StringColumnStatisticsData struct{}" + } + + return strings.Join([]string{"StringColumnStatisticsData", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table.go new file mode 100644 index 00000000..e3aa66e0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table.go @@ -0,0 +1,168 @@ +package model + +import ( + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + "strings" +) + +// table +type Table struct { + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名字 + TableName string `json:"table_name"` + + // 表创建时间 + CreateTime *sdktime.SdkTime `json:"create_time"` + + // 最后访问时间 + LastAccessTime *sdktime.SdkTime `json:"last_access_time"` + + // 表元数据最后一次修改时间 + UpdateTime *sdktime.SdkTime `json:"update_time,omitempty"` + + // 上一次做列级别的统计信息计算的时间 + LastAnalyzedTime *sdktime.SdkTime `json:"last_analyzed_time,omitempty"` + + // 用户信息 + Owner string `json:"owner"` + + // 用户类型 + OwnerType TableOwnerType `json:"owner_type"` + + // 参数 + Parameters map[string]string `json:"parameters"` + + // 表分区列的列表 + PartitionKeys []Column `json:"partition_keys"` + + // 表保留时间 + Retention int32 `json:"retention"` + + StorageDescriptor *StorageDescriptor `json:"storage_descriptor"` + + // 表类型 + TableType TableTableType `json:"table_type"` + + // 表描述信息 + Comments *string `json:"comments,omitempty"` + + // 如果表是视图,则为视图的扩展文本;否则为 null + ViewExpandedText string `json:"view_expanded_text"` + + // 如果表是视图,则为视图的原始文本;否则为 null + ViewOriginalText string `json:"view_original_text"` +} + +func (o Table) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Table struct{}" + } + + return strings.Join([]string{"Table", string(data)}, " ") +} + +type TableOwnerType struct { + value string +} + +type TableOwnerTypeEnum struct { + USER TableOwnerType + GROUP TableOwnerType + ROLE TableOwnerType +} + +func GetTableOwnerTypeEnum() TableOwnerTypeEnum { + return TableOwnerTypeEnum{ + USER: TableOwnerType{ + value: "USER", + }, + GROUP: TableOwnerType{ + value: "GROUP", + }, + ROLE: TableOwnerType{ + value: "ROLE", + }, + } +} + +func (c TableOwnerType) Value() string { + return c.value +} + +func (c TableOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *TableOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type TableTableType struct { + value string +} + +type TableTableTypeEnum struct { + MANAGED_TABLE TableTableType + EXTERNAL_TABLE TableTableType + VIRTUAL_VIEW TableTableType + MATERIALIZED_VIEW TableTableType +} + +func GetTableTableTypeEnum() TableTableTypeEnum { + return TableTableTypeEnum{ + MANAGED_TABLE: TableTableType{ + value: "MANAGED_TABLE", + }, + EXTERNAL_TABLE: TableTableType{ + value: "EXTERNAL_TABLE", + }, + VIRTUAL_VIEW: TableTableType{ + value: "VIRTUAL_VIEW", + }, + MATERIALIZED_VIEW: TableTableType{ + value: "MATERIALIZED_VIEW", + }, + } +} + +func (c TableTableType) Value() string { + return c.value +} + +func (c TableTableType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *TableTableType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_column_statistics.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_column_statistics.go new file mode 100644 index 00000000..85cac3ce --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_column_statistics.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 表中列的统计 +type TableColumnStatistics struct { + ColumnStatisticsDesc *TableColumnStatisticsDescription `json:"column_statistics_desc"` + + // 列统计信息 + ColumnStatisticsObjects []ColumnStatisticsObj `json:"column_statistics_objects"` +} + +func (o TableColumnStatistics) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TableColumnStatistics struct{}" + } + + return strings.Join([]string{"TableColumnStatistics", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_column_statistics_description.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_column_statistics_description.go new file mode 100644 index 00000000..1a8a3422 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_column_statistics_description.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 表列统计信息的描述信息 +type TableColumnStatisticsDescription struct { + + // 最后统计时间 + LastAnalyzedTime *sdktime.SdkTime `json:"last_analyzed_time"` +} + +func (o TableColumnStatisticsDescription) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TableColumnStatisticsDescription struct{}" + } + + return strings.Join([]string{"TableColumnStatisticsDescription", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_constraints_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_constraints_input.go new file mode 100644 index 00000000..2903c735 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_constraints_input.go @@ -0,0 +1,102 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// 表列限制条件输入模型 +type TableConstraintsInput struct { + + // 限制类型 + ConstraintType *TableConstraintsInputConstraintType `json:"constraint_type,omitempty"` + + // 外键列表 + ForeignKeys *[]ForeignKeyInput `json:"foreign_keys,omitempty"` + + // 主键列表 + PrimaryKeys *[]PrimaryKeyInput `json:"primary_keys,omitempty"` + + // 非空限制列表 + NotNullConstraints *[]NotNullConstraintInput `json:"not_null_constraints,omitempty"` + + // 检查限制列表 + CheckConstraints *[]CheckConstraintInput `json:"check_constraints,omitempty"` + + // 唯一值限制列表 + UniqueConstraints *[]UniqueConstraintInput `json:"unique_constraints,omitempty"` + + // 默认限制列表 + DefaultConstraints *[]DefaultConstraintInput `json:"default_constraints,omitempty"` +} + +func (o TableConstraintsInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TableConstraintsInput struct{}" + } + + return strings.Join([]string{"TableConstraintsInput", string(data)}, " ") +} + +type TableConstraintsInputConstraintType struct { + value string +} + +type TableConstraintsInputConstraintTypeEnum struct { + CHECK_CSTR TableConstraintsInputConstraintType + DEFAULT_CSTR TableConstraintsInputConstraintType + NOT_NULL_CSTR TableConstraintsInputConstraintType + UNIQUE_CSTR TableConstraintsInputConstraintType + PRIMARY_KEY TableConstraintsInputConstraintType + FOREIGN_KEY TableConstraintsInputConstraintType +} + +func GetTableConstraintsInputConstraintTypeEnum() TableConstraintsInputConstraintTypeEnum { + return TableConstraintsInputConstraintTypeEnum{ + CHECK_CSTR: TableConstraintsInputConstraintType{ + value: "CHECK_CSTR", + }, + DEFAULT_CSTR: TableConstraintsInputConstraintType{ + value: "DEFAULT_CSTR", + }, + NOT_NULL_CSTR: TableConstraintsInputConstraintType{ + value: "NOT_NULL_CSTR", + }, + UNIQUE_CSTR: TableConstraintsInputConstraintType{ + value: "UNIQUE_CSTR", + }, + PRIMARY_KEY: TableConstraintsInputConstraintType{ + value: "PRIMARY_KEY", + }, + FOREIGN_KEY: TableConstraintsInputConstraintType{ + value: "FOREIGN_KEY", + }, + } +} + +func (c TableConstraintsInputConstraintType) Value() string { + return c.value +} + +func (c TableConstraintsInputConstraintType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *TableConstraintsInputConstraintType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_info.go new file mode 100644 index 00000000..ed3ab3f6 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_info.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// table input when grant policy +type TableInfo struct { + Columns *ColumnInfo `json:"columns,omitempty"` + + // table name + Name string `json:"name"` +} + +func (o TableInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TableInfo struct{}" + } + + return strings.Join([]string{"TableInfo", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_input.go new file mode 100644 index 00000000..4806f440 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_input.go @@ -0,0 +1,159 @@ +package model + +import ( + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + "strings" +) + +// 表输入模型 +type TableInput struct { + + // 表名字 + TableName string `json:"table_name"` + + // 表类型 + TableType TableInputTableType `json:"table_type"` + + // 表所有者 + Owner string `json:"owner"` + + // 所有者类型 + OwnerType TableInputOwnerType `json:"owner_type"` + + // 表创建时间 + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 最近一次访问时间 + LastAccessTime *sdktime.SdkTime `json:"last_access_time,omitempty"` + + // 最近一次分析统计时间 + LastAnalyzedTime *sdktime.SdkTime `json:"last_analyzed_time,omitempty"` + + // 分区列的信息 + PartitionKeys *[]Column `json:"partition_keys,omitempty"` + + // 表保留时间 + Retention *int32 `json:"retention,omitempty"` + + StorageDescriptor *StorageDescriptor `json:"storage_descriptor"` + + // 表参数信息,每个键是一个键字符串,不少于 1 个字节或超过 255 个字节 每个值是一个 UTF-8 字符串,不超过 4000 个字节 + Parameters map[string]string `json:"parameters,omitempty"` + + // 表描述信息 + Comments *string `json:"comments,omitempty"` + + // 如果表是视图,则为视图的扩展文本;否则为 null + ViewExpandedText *string `json:"view_expanded_text,omitempty"` + + // 如果表是视图,则为视图的原始文本;否则为 null + ViewOriginalText *string `json:"view_original_text,omitempty"` +} + +func (o TableInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TableInput struct{}" + } + + return strings.Join([]string{"TableInput", string(data)}, " ") +} + +type TableInputTableType struct { + value string +} + +type TableInputTableTypeEnum struct { + MANAGED_TABLE TableInputTableType + EXTERNAL_TABLE TableInputTableType + VIRTUAL_VIEW TableInputTableType + MATERIALIZED_VIEW TableInputTableType +} + +func GetTableInputTableTypeEnum() TableInputTableTypeEnum { + return TableInputTableTypeEnum{ + MANAGED_TABLE: TableInputTableType{ + value: "MANAGED_TABLE", + }, + EXTERNAL_TABLE: TableInputTableType{ + value: "EXTERNAL_TABLE", + }, + VIRTUAL_VIEW: TableInputTableType{ + value: "VIRTUAL_VIEW", + }, + MATERIALIZED_VIEW: TableInputTableType{ + value: "MATERIALIZED_VIEW", + }, + } +} + +func (c TableInputTableType) Value() string { + return c.value +} + +func (c TableInputTableType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *TableInputTableType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type TableInputOwnerType struct { + value string +} + +type TableInputOwnerTypeEnum struct { + USER TableInputOwnerType + GROUP TableInputOwnerType + ROLE TableInputOwnerType +} + +func GetTableInputOwnerTypeEnum() TableInputOwnerTypeEnum { + return TableInputOwnerTypeEnum{ + USER: TableInputOwnerType{ + value: "USER", + }, + GROUP: TableInputOwnerType{ + value: "GROUP", + }, + ROLE: TableInputOwnerType{ + value: "ROLE", + }, + } +} + +func (c TableInputOwnerType) Value() string { + return c.value +} + +func (c TableInputOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *TableInputOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_meta.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_meta.go new file mode 100644 index 00000000..812538b0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_table_meta.go @@ -0,0 +1,88 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// 表描述信息 +type TableMeta struct { + + // 表名 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名字 + TableName string `json:"table_name"` + + // 表类型 + TableType TableMetaTableType `json:"table_type"` + + // 表描述信息 + Comments string `json:"comments"` +} + +func (o TableMeta) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TableMeta struct{}" + } + + return strings.Join([]string{"TableMeta", string(data)}, " ") +} + +type TableMetaTableType struct { + value string +} + +type TableMetaTableTypeEnum struct { + MANAGED_TABLE TableMetaTableType + EXTERNAL_TABLE TableMetaTableType + VIRTUAL_VIEW TableMetaTableType + MATERIALIZED_VIEW TableMetaTableType +} + +func GetTableMetaTableTypeEnum() TableMetaTableTypeEnum { + return TableMetaTableTypeEnum{ + MANAGED_TABLE: TableMetaTableType{ + value: "MANAGED_TABLE", + }, + EXTERNAL_TABLE: TableMetaTableType{ + value: "EXTERNAL_TABLE", + }, + VIRTUAL_VIEW: TableMetaTableType{ + value: "VIRTUAL_VIEW", + }, + MATERIALIZED_VIEW: TableMetaTableType{ + value: "MATERIALIZED_VIEW", + }, + } +} + +func (c TableMetaTableType) Value() string { + return c.value +} + +func (c TableMetaTableType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *TableMetaTableType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_tenant_agreement.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_tenant_agreement.go new file mode 100644 index 00000000..4cc5d5a5 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_tenant_agreement.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 租户协议 +type TenantAgreement struct { + + // 协议名称 + AgreementName *string `json:"agreement_name,omitempty"` + + // 协议版本号 + AgreementVersion *string `json:"agreement_version,omitempty"` +} + +func (o TenantAgreement) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TenantAgreement struct{}" + } + + return strings.Join([]string{"TenantAgreement", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_tenant_agreement_body.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_tenant_agreement_body.go new file mode 100644 index 00000000..2112555c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_tenant_agreement_body.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 租户注册协议响应体 +type TenantAgreementBody struct { + + // 租户协议列表 + Agreements *[]TenantAgreement `json:"agreements,omitempty"` +} + +func (o TenantAgreementBody) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TenantAgreementBody struct{}" + } + + return strings.Join([]string{"TenantAgreementBody", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_truncate_partition_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_truncate_partition_input.go new file mode 100644 index 00000000..fa4705a2 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_truncate_partition_input.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 清空分区数据 +type TruncatePartitionInput struct { + + // 分区值 + PartitionValues *[][]string `json:"partition_values,omitempty"` +} + +func (o TruncatePartitionInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TruncatePartitionInput struct{}" + } + + return strings.Join([]string{"TruncatePartitionInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_unique_constraint.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_unique_constraint.go new file mode 100644 index 00000000..26601a3d --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_unique_constraint.go @@ -0,0 +1,46 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type UniqueConstraint struct { + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + // 列名 + ColumnName string `json:"column_name"` + + // constraint Name + ConstraintName string `json:"constraint_name"` + + // 列序号(限制条件中第几位) + KeySequence *int32 `json:"key_sequence,omitempty"` + + // enable constraint + EnableConstraint bool `json:"enable_constraint"` + + // constraint is rely when Query + RelyConstraint bool `json:"rely_constraint"` + + // constraint is validated + ValidateConstraint bool `json:"validate_constraint"` +} + +func (o UniqueConstraint) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UniqueConstraint struct{}" + } + + return strings.Join([]string{"UniqueConstraint", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_unique_constraint_input.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_unique_constraint_input.go new file mode 100644 index 00000000..123c3978 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_unique_constraint_input.go @@ -0,0 +1,37 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type UniqueConstraintInput struct { + + // 列名 + ColumnName string `json:"column_name"` + + // constraint Name + ConstraintName string `json:"constraint_name"` + + // 列序号(限制条件中第几位) + KeySequence *int32 `json:"key_sequence,omitempty"` + + // enable constraint + EnableConstraint bool `json:"enable_constraint"` + + // constraint is rely when Query + RelyConstraint bool `json:"rely_constraint"` + + // constraint is validated + ValidateConstraint bool `json:"validate_constraint"` +} + +func (o UniqueConstraintInput) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UniqueConstraintInput struct{}" + } + + return strings.Join([]string{"UniqueConstraintInput", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_catalog_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_catalog_request.go new file mode 100644 index 00000000..c4b7832d --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_catalog_request.go @@ -0,0 +1,28 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type UpdateCatalogRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + Body *CatalogInput `json:"body,omitempty"` +} + +func (o UpdateCatalogRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateCatalogRequest struct{}" + } + + return strings.Join([]string{"UpdateCatalogRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_catalog_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_catalog_response.go new file mode 100644 index 00000000..c5997f4a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_catalog_response.go @@ -0,0 +1,33 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type UpdateCatalogResponse struct { + + // catalog名字 + CatalogName *string `json:"catalog_name,omitempty"` + + // 描述信息 + Description *string `json:"description,omitempty"` + + // 路径地址 + Location *string `json:"location,omitempty"` + + // database路径列表 + DatabaseLocationList *[]string `json:"database_location_list,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o UpdateCatalogResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateCatalogResponse struct{}" + } + + return strings.Join([]string{"UpdateCatalogResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_database_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_database_request.go new file mode 100644 index 00000000..4561010c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_database_request.go @@ -0,0 +1,31 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type UpdateDatabaseRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + Body *DatabaseInput `json:"body,omitempty"` +} + +func (o UpdateDatabaseRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateDatabaseRequest struct{}" + } + + return strings.Join([]string{"UpdateDatabaseRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_database_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_database_response.go new file mode 100644 index 00000000..8d3d00a0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_database_response.go @@ -0,0 +1,97 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// Response Object +type UpdateDatabaseResponse struct { + + // catalog名字 + CatalogName *string `json:"catalog_name,omitempty"` + + // 数据库名 + DatabaseName *string `json:"database_name,omitempty"` + + // 数据库所有者 + Owner *string `json:"owner,omitempty"` + + // 所有者类型 + OwnerType *UpdateDatabaseResponseOwnerType `json:"owner_type,omitempty"` + + // 数据库描述信息 + Description *string `json:"description,omitempty"` + + // 数据库路径地址 + Location *string `json:"location,omitempty"` + + // 参数信息 + Parameters map[string]string `json:"parameters,omitempty"` + + // 表路径列表 + TableLocationList *[]string `json:"table_location_list,omitempty"` + + // 函数路径列表 + FunctionLocationList *[]string `json:"function_location_list,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o UpdateDatabaseResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateDatabaseResponse struct{}" + } + + return strings.Join([]string{"UpdateDatabaseResponse", string(data)}, " ") +} + +type UpdateDatabaseResponseOwnerType struct { + value string +} + +type UpdateDatabaseResponseOwnerTypeEnum struct { + USER UpdateDatabaseResponseOwnerType + GROUP UpdateDatabaseResponseOwnerType + ROLE UpdateDatabaseResponseOwnerType +} + +func GetUpdateDatabaseResponseOwnerTypeEnum() UpdateDatabaseResponseOwnerTypeEnum { + return UpdateDatabaseResponseOwnerTypeEnum{ + USER: UpdateDatabaseResponseOwnerType{ + value: "USER", + }, + GROUP: UpdateDatabaseResponseOwnerType{ + value: "GROUP", + }, + ROLE: UpdateDatabaseResponseOwnerType{ + value: "ROLE", + }, + } +} + +func (c UpdateDatabaseResponseOwnerType) Value() string { + return c.value +} + +func (c UpdateDatabaseResponseOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *UpdateDatabaseResponseOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_function_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_function_request.go new file mode 100644 index 00000000..8edd69b0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_function_request.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type UpdateFunctionRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 函数名字 + FunctionName string `json:"function_name"` + + Body *FunctionInput `json:"body,omitempty"` +} + +func (o UpdateFunctionRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateFunctionRequest struct{}" + } + + return strings.Join([]string{"UpdateFunctionRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_function_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_function_response.go new file mode 100644 index 00000000..81941698 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_function_response.go @@ -0,0 +1,134 @@ +package model + +import ( + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + "strings" +) + +// Response Object +type UpdateFunctionResponse struct { + + // catalog名字 + CatalogName *string `json:"catalog_name,omitempty"` + + // 数据库名字 + DatabaseName *string `json:"database_name,omitempty"` + + // 函数名 + FunctionName *string `json:"function_name,omitempty"` + + // 函数类型 + FunctionType *UpdateFunctionResponseFunctionType `json:"function_type,omitempty"` + + // 函数所有者 + Owner *string `json:"owner,omitempty"` + + // 所有者类型 + OwnerType *UpdateFunctionResponseOwnerType `json:"owner_type,omitempty"` + + // 函数类名 + ClassName *string `json:"class_name,omitempty"` + + // 创建时间格式为yyyy-mm-ddThh:mm:sss + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 函数地址信息 + ResourceUris *[]FunctionResourceUri `json:"resource_uris,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o UpdateFunctionResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateFunctionResponse struct{}" + } + + return strings.Join([]string{"UpdateFunctionResponse", string(data)}, " ") +} + +type UpdateFunctionResponseFunctionType struct { + value string +} + +type UpdateFunctionResponseFunctionTypeEnum struct { + JAVA UpdateFunctionResponseFunctionType +} + +func GetUpdateFunctionResponseFunctionTypeEnum() UpdateFunctionResponseFunctionTypeEnum { + return UpdateFunctionResponseFunctionTypeEnum{ + JAVA: UpdateFunctionResponseFunctionType{ + value: "JAVA", + }, + } +} + +func (c UpdateFunctionResponseFunctionType) Value() string { + return c.value +} + +func (c UpdateFunctionResponseFunctionType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *UpdateFunctionResponseFunctionType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type UpdateFunctionResponseOwnerType struct { + value string +} + +type UpdateFunctionResponseOwnerTypeEnum struct { + USER UpdateFunctionResponseOwnerType + GROUP UpdateFunctionResponseOwnerType + ROLE UpdateFunctionResponseOwnerType +} + +func GetUpdateFunctionResponseOwnerTypeEnum() UpdateFunctionResponseOwnerTypeEnum { + return UpdateFunctionResponseOwnerTypeEnum{ + USER: UpdateFunctionResponseOwnerType{ + value: "USER", + }, + GROUP: UpdateFunctionResponseOwnerType{ + value: "GROUP", + }, + ROLE: UpdateFunctionResponseOwnerType{ + value: "ROLE", + }, + } +} + +func (c UpdateFunctionResponseOwnerType) Value() string { + return c.value +} + +func (c UpdateFunctionResponseOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *UpdateFunctionResponseOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_lake_formation_instance.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_lake_formation_instance.go new file mode 100644 index 00000000..18261466 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_lake_formation_instance.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// 修改实例信息 +type UpdateLakeFormationInstance struct { + + // 实例名称 + Name string `json:"name"` + + // 实例描述 + Description *string `json:"description,omitempty"` +} + +func (o UpdateLakeFormationInstance) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateLakeFormationInstance struct{}" + } + + return strings.Join([]string{"UpdateLakeFormationInstance", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_lake_formation_instance_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_lake_formation_instance_request.go new file mode 100644 index 00000000..4efee421 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_lake_formation_instance_request.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type UpdateLakeFormationInstanceRequest struct { + + // LakeFormation实例ID + InstanceId string `json:"instance_id"` + + Body *UpdateLakeFormationInstance `json:"body,omitempty"` +} + +func (o UpdateLakeFormationInstanceRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateLakeFormationInstanceRequest struct{}" + } + + return strings.Join([]string{"UpdateLakeFormationInstanceRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_lake_formation_instance_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_lake_formation_instance_response.go new file mode 100644 index 00000000..56a2147c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_lake_formation_instance_response.go @@ -0,0 +1,49 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type UpdateLakeFormationInstanceResponse struct { + + // LakeFormation实例Id + InstanceId *string `json:"instance_id,omitempty"` + + // 实例名 + Name *string `json:"name,omitempty"` + + // 描述 + Description *string `json:"description,omitempty"` + + // 企业项目Id + EnterpriseProjectId *string `json:"enterprise_project_id,omitempty"` + + // 逻辑多租和物理多租的判断 + Shared *bool `json:"shared,omitempty"` + + // 实例创建时间戳 + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 实例更新时间戳 + UpdateTime *sdktime.SdkTime `json:"update_time,omitempty"` + + // 实例状态 + Status *string `json:"status,omitempty"` + + // 是否在回收站 + InRecycleBin *bool `json:"in_recycle_bin,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o UpdateLakeFormationInstanceResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateLakeFormationInstanceResponse struct{}" + } + + return strings.Join([]string{"UpdateLakeFormationInstanceResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_role_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_role_request.go new file mode 100644 index 00000000..f2aebb63 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_role_request.go @@ -0,0 +1,28 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type UpdateRoleRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // 角色名称 + RoleName string `json:"role_name"` + + Body *AlterRoleInput `json:"body,omitempty"` +} + +func (o UpdateRoleRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateRoleRequest struct{}" + } + + return strings.Join([]string{"UpdateRoleRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_role_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_role_response.go new file mode 100644 index 00000000..0fba6c77 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_role_response.go @@ -0,0 +1,87 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// Response Object +type UpdateRoleResponse struct { + + // role名字 + RoleName *string `json:"role_name,omitempty"` + + // 描述信息 + Description *string `json:"description,omitempty"` + + // 主体来源 IAM云用户 SAML联邦 LDAP ld用户 LOCAL 本地用户 OTHER 其它 + PrincipalSource *UpdateRoleResponsePrincipalSource `json:"principal_source,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o UpdateRoleResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateRoleResponse struct{}" + } + + return strings.Join([]string{"UpdateRoleResponse", string(data)}, " ") +} + +type UpdateRoleResponsePrincipalSource struct { + value string +} + +type UpdateRoleResponsePrincipalSourceEnum struct { + IAM UpdateRoleResponsePrincipalSource + SAML UpdateRoleResponsePrincipalSource + LDAP UpdateRoleResponsePrincipalSource + LOCAL UpdateRoleResponsePrincipalSource + OTHER UpdateRoleResponsePrincipalSource +} + +func GetUpdateRoleResponsePrincipalSourceEnum() UpdateRoleResponsePrincipalSourceEnum { + return UpdateRoleResponsePrincipalSourceEnum{ + IAM: UpdateRoleResponsePrincipalSource{ + value: "IAM", + }, + SAML: UpdateRoleResponsePrincipalSource{ + value: "SAML", + }, + LDAP: UpdateRoleResponsePrincipalSource{ + value: "LDAP", + }, + LOCAL: UpdateRoleResponsePrincipalSource{ + value: "LOCAL", + }, + OTHER: UpdateRoleResponsePrincipalSource{ + value: "OTHER", + }, + } +} + +func (c UpdateRoleResponsePrincipalSource) Value() string { + return c.value +} + +func (c UpdateRoleResponsePrincipalSource) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *UpdateRoleResponsePrincipalSource) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_table_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_table_request.go new file mode 100644 index 00000000..ca81f25c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_table_request.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type UpdateTableRequest struct { + + // 实例Id + InstanceId string `json:"instance_id"` + + // catalog名字 + CatalogName string `json:"catalog_name"` + + // 数据库名字 + DatabaseName string `json:"database_name"` + + // 表名称 + TableName string `json:"table_name"` + + Body *AlterTableInput `json:"body,omitempty"` +} + +func (o UpdateTableRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateTableRequest struct{}" + } + + return strings.Join([]string{"UpdateTableRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_table_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_table_response.go new file mode 100644 index 00000000..af6583d3 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_update_table_response.go @@ -0,0 +1,169 @@ +package model + +import ( + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + "strings" +) + +// Response Object +type UpdateTableResponse struct { + + // catalog名字 + CatalogName *string `json:"catalog_name,omitempty"` + + // 数据库名字 + DatabaseName *string `json:"database_name,omitempty"` + + // 表名字 + TableName *string `json:"table_name,omitempty"` + + // 表创建时间 + CreateTime *sdktime.SdkTime `json:"create_time,omitempty"` + + // 最后访问时间 + LastAccessTime *sdktime.SdkTime `json:"last_access_time,omitempty"` + + // 表元数据最后一次修改时间 + UpdateTime *sdktime.SdkTime `json:"update_time,omitempty"` + + // 上一次做列级别的统计信息计算的时间 + LastAnalyzedTime *sdktime.SdkTime `json:"last_analyzed_time,omitempty"` + + // 用户信息 + Owner *string `json:"owner,omitempty"` + + // 用户类型 + OwnerType *UpdateTableResponseOwnerType `json:"owner_type,omitempty"` + + // 参数 + Parameters map[string]string `json:"parameters,omitempty"` + + // 表分区列的列表 + PartitionKeys *[]Column `json:"partition_keys,omitempty"` + + // 表保留时间 + Retention *int32 `json:"retention,omitempty"` + + StorageDescriptor *StorageDescriptor `json:"storage_descriptor,omitempty"` + + // 表类型 + TableType *UpdateTableResponseTableType `json:"table_type,omitempty"` + + // 表描述信息 + Comments *string `json:"comments,omitempty"` + + // 如果表是视图,则为视图的扩展文本;否则为 null + ViewExpandedText *string `json:"view_expanded_text,omitempty"` + + // 如果表是视图,则为视图的原始文本;否则为 null + ViewOriginalText *string `json:"view_original_text,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o UpdateTableResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateTableResponse struct{}" + } + + return strings.Join([]string{"UpdateTableResponse", string(data)}, " ") +} + +type UpdateTableResponseOwnerType struct { + value string +} + +type UpdateTableResponseOwnerTypeEnum struct { + USER UpdateTableResponseOwnerType + GROUP UpdateTableResponseOwnerType + ROLE UpdateTableResponseOwnerType +} + +func GetUpdateTableResponseOwnerTypeEnum() UpdateTableResponseOwnerTypeEnum { + return UpdateTableResponseOwnerTypeEnum{ + USER: UpdateTableResponseOwnerType{ + value: "USER", + }, + GROUP: UpdateTableResponseOwnerType{ + value: "GROUP", + }, + ROLE: UpdateTableResponseOwnerType{ + value: "ROLE", + }, + } +} + +func (c UpdateTableResponseOwnerType) Value() string { + return c.value +} + +func (c UpdateTableResponseOwnerType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *UpdateTableResponseOwnerType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type UpdateTableResponseTableType struct { + value string +} + +type UpdateTableResponseTableTypeEnum struct { + MANAGED_TABLE UpdateTableResponseTableType + EXTERNAL_TABLE UpdateTableResponseTableType + VIRTUAL_VIEW UpdateTableResponseTableType + MATERIALIZED_VIEW UpdateTableResponseTableType +} + +func GetUpdateTableResponseTableTypeEnum() UpdateTableResponseTableTypeEnum { + return UpdateTableResponseTableTypeEnum{ + MANAGED_TABLE: UpdateTableResponseTableType{ + value: "MANAGED_TABLE", + }, + EXTERNAL_TABLE: UpdateTableResponseTableType{ + value: "EXTERNAL_TABLE", + }, + VIRTUAL_VIEW: UpdateTableResponseTableType{ + value: "VIRTUAL_VIEW", + }, + MATERIALIZED_VIEW: UpdateTableResponseTableType{ + value: "MATERIALIZED_VIEW", + }, + } +} + +func (c UpdateTableResponseTableType) Value() string { + return c.value +} + +func (c UpdateTableResponseTableType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *UpdateTableResponseTableType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_user_group.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_user_group.go new file mode 100644 index 00000000..04099d64 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_user_group.go @@ -0,0 +1,86 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// usergroup +type UserGroup struct { + + // 用户组名 + GroupName string `json:"group_name"` + + // 用户组类型 + GroupSource UserGroupGroupSource `json:"group_source"` + + // 用户组id + GroupId string `json:"group_id"` +} + +func (o UserGroup) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UserGroup struct{}" + } + + return strings.Join([]string{"UserGroup", string(data)}, " ") +} + +type UserGroupGroupSource struct { + value string +} + +type UserGroupGroupSourceEnum struct { + IAM UserGroupGroupSource + SAML UserGroupGroupSource + LDAP UserGroupGroupSource + LOCAL UserGroupGroupSource + OTHER UserGroupGroupSource +} + +func GetUserGroupGroupSourceEnum() UserGroupGroupSourceEnum { + return UserGroupGroupSourceEnum{ + IAM: UserGroupGroupSource{ + value: "IAM", + }, + SAML: UserGroupGroupSource{ + value: "SAML", + }, + LDAP: UserGroupGroupSource{ + value: "LDAP", + }, + LOCAL: UserGroupGroupSource{ + value: "LOCAL", + }, + OTHER: UserGroupGroupSource{ + value: "OTHER", + }, + } +} + +func (c UserGroupGroupSource) Value() string { + return c.value +} + +func (c UserGroupGroupSource) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *UserGroupGroupSource) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_user_role.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_user_role.go new file mode 100644 index 00000000..6f9850f0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_user_role.go @@ -0,0 +1,128 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +// 角色拥有的用户/用户模型 +type UserRole struct { + + // 主体类型 USER用户 GROUP组 + PrincipalType UserRolePrincipalType `json:"principal_type"` + + // 主体名称 + PrincipalName string `json:"principal_name"` + + // 主体来源 IAM云用户 SAML联邦 LDAP ld用户 LOCAL 本地用户 OTHER 其它 + PrincipalSource UserRolePrincipalSource `json:"principal_source"` +} + +func (o UserRole) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UserRole struct{}" + } + + return strings.Join([]string{"UserRole", string(data)}, " ") +} + +type UserRolePrincipalType struct { + value string +} + +type UserRolePrincipalTypeEnum struct { + USER UserRolePrincipalType + GROUP UserRolePrincipalType +} + +func GetUserRolePrincipalTypeEnum() UserRolePrincipalTypeEnum { + return UserRolePrincipalTypeEnum{ + USER: UserRolePrincipalType{ + value: "USER", + }, + GROUP: UserRolePrincipalType{ + value: "GROUP", + }, + } +} + +func (c UserRolePrincipalType) Value() string { + return c.value +} + +func (c UserRolePrincipalType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *UserRolePrincipalType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type UserRolePrincipalSource struct { + value string +} + +type UserRolePrincipalSourceEnum struct { + IAM UserRolePrincipalSource + SAML UserRolePrincipalSource + LDAP UserRolePrincipalSource + LOCAL UserRolePrincipalSource + OTHER UserRolePrincipalSource +} + +func GetUserRolePrincipalSourceEnum() UserRolePrincipalSourceEnum { + return UserRolePrincipalSourceEnum{ + IAM: UserRolePrincipalSource{ + value: "IAM", + }, + SAML: UserRolePrincipalSource{ + value: "SAML", + }, + LDAP: UserRolePrincipalSource{ + value: "LDAP", + }, + LOCAL: UserRolePrincipalSource{ + value: "LOCAL", + }, + OTHER: UserRolePrincipalSource{ + value: "OTHER", + }, + } +} + +func (c UserRolePrincipalSource) Value() string { + return c.value +} + +func (c UserRolePrincipalSource) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *UserRolePrincipalSource) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_validity_interval.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_validity_interval.go new file mode 100644 index 00000000..6bfac6d4 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_validity_interval.go @@ -0,0 +1,28 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type ValidityInterval struct { + + // 日 + Days *int32 `json:"days,omitempty"` + + // 时 + Hours *int32 `json:"hours,omitempty"` + + // 分 + Minutes *int32 `json:"minutes,omitempty"` +} + +func (o ValidityInterval) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ValidityInterval struct{}" + } + + return strings.Join([]string{"ValidityInterval", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_validity_recurrence.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_validity_recurrence.go new file mode 100644 index 00000000..e6423036 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_validity_recurrence.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type ValidityRecurrence struct { + Interval *ValidityInterval `json:"interval,omitempty"` + + Schedule *RecurrenceSchedule `json:"schedule,omitempty"` +} + +func (o ValidityRecurrence) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ValidityRecurrence struct{}" + } + + return strings.Join([]string{"ValidityRecurrence", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_validity_schedule.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_validity_schedule.go new file mode 100644 index 00000000..93a94005 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model/model_validity_schedule.go @@ -0,0 +1,31 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type ValiditySchedule struct { + + // end时间 + EndTime *string `json:"end_time,omitempty"` + + // 策略递归 + Recurrences *[]ValidityRecurrence `json:"recurrences,omitempty"` + + // 开始时间 + StartTime *string `json:"start_time,omitempty"` + + // 时间域 + TimeZone *string `json:"time_zone,omitempty"` +} + +func (o ValiditySchedule) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ValiditySchedule struct{}" + } + + return strings.Join([]string{"ValiditySchedule", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_add_jobs_req_v11.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_add_jobs_req_v11.go new file mode 100644 index 00000000..3802fddc --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_add_jobs_req_v11.go @@ -0,0 +1,55 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type AddJobsReqV11 struct { + + // 作业类型码。 - 1:MapReduce - 2:Spark - 3:Hive Script - 4:HiveSQL(当前不支持) - 5:DistCp,导入、导出数据,(当前不支持)。 - 6:Spark Script - 7:Spark SQL,提交SQL语句,(当前不支持)。 + JobType int32 `json:"job_type"` + + // 作业名称。 只能由字母、数字、中划线和下划线组成,并且长度为1~64个字符。 说明: 不同作业的名称允许相同,但不建议设置相同。 + JobName string `json:"job_name"` + + // 执行程序Jar包或sql文件地址,需要满足如下要求: - 最多为1023字符,不能包含;|&>,<'$特殊字符,且不可为空或全空格。 - 文件可存储于HDFS或者OBS中,不同的文件系统对应的路径存在差异。 - OBS:以“s3a://”开头。不支持KMS加密的文件或程序。 - HDFS:以“/”开头。 - Spark Script需要以“.sql”结尾,MapReduce和Spark Jar需要以“.jar”结尾,sql和jar不区分大小写。 + JarPath *string `json:"jar_path,omitempty"` + + // 程序执行的关键参数,该参数由用户程序内的函数指定,MRS只负责参数的传入。 最多为150000字符,不能包含;|&>'<$特殊字符,可为空。 + Arguments *string `json:"arguments,omitempty"` + + // 数据输入地址。 文件可存储于HDFS或者OBS中,不同的文件系统对应的路径存在差异。 - OBS:以“s3a://”开头。不支持KMS加密的文件或程序。 - HDFS:以“/”开头。 最多为1023字符,不能包含;|&>'<$特殊字符,可为空。 + Input *string `json:"input,omitempty"` + + // 数据输出地址。 文件可存储于HDFS或者OBS中,不同的文件系统对应的路径存在差异。 - OBS:以“s3a://”开头。 - HDFS:以“/”开头。 如果该路径不存在,系统会自动创建。 最多为1023字符,不能包含;|&>'<$特殊字符,可为空。 + Output *string `json:"output,omitempty"` + + // 作业日志存储地址,该日志信息记录作业运行状态。 文件可存储于HDFS或者OBS中,不同的文件系统对应的路径存在差异。 - OBS:以“s3a://”开头。 - HDFS:以“/”开头。 最多为1023字符,不能包含;|&>'<$特殊字符,可为空。 + JobLog *string `json:"job_log,omitempty"` + + // sql程序路径,仅Spark Script和Hive Script作业需要使用此参数。需要满足如下要求: - 最多为1023字符,不能包含;|&><'$特殊字符,且不可为空或全空格。 - 文件可存储于HDFS或者OBS中,不同的文件系统对应的路径存在差异。 - OBS:以“s3a://”开头。不支持KMS加密的文件或程序。 - HDFS:以“/”开头。 - 需要以“.sql”结尾,sql不区分大小写。 + HiveScriptPath *string `json:"hive_script_path,omitempty"` + + // HQL脚本语句。 + Hql *string `json:"hql,omitempty"` + + // 作业执行完成后,是否删除集群。 - true:是 - false:否 + ShutdownCluster *bool `json:"shutdown_cluster,omitempty"` + + // - true:创建集群同时提交作业 - false:单独提交作业 此处应设置为true。 + SubmitJobOnceClusterRun bool `json:"submit_job_once_cluster_run"` + + // 数据导入导出。 - import - export + FileAction *string `json:"file_action,omitempty"` +} + +func (o AddJobsReqV11) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AddJobsReqV11 struct{}" + } + + return strings.Join([]string{"AddJobsReqV11", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_auto_scaling_policy.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_auto_scaling_policy.go new file mode 100644 index 00000000..717a85ed --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_auto_scaling_policy.go @@ -0,0 +1,37 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type AutoScalingPolicy struct { + + // 当前自动伸缩规则是否开启。 + AutoScalingEnable bool `json:"auto_scaling_enable"` + + // 指定该节点组的最小保留节点数。 取值范围:[0~500] + MinCapacity int32 `json:"min_capacity"` + + // 指定该节点组的最大节点数。 取值范围:[0~500] + MaxCapacity int32 `json:"max_capacity"` + + // 资源计划列表。若该参数为空表示不启用资源计划。 当启用弹性伸缩时,资源计划与自动伸缩规则需至少配置其中一种。 + ResourcesPlans *[]ResourcesPlan `json:"resources_plans,omitempty"` + + // 自动伸缩的规则列表。 当启用弹性伸缩时,资源计划与自动伸缩规则需至少配置其中一种。 + Rules *[]Rule `json:"rules,omitempty"` + + // 弹性伸缩自定义自动化脚本列表。若该参数为空表示不启用自动化脚本。 + ExecScripts *[]ScaleScript `json:"exec_scripts,omitempty"` +} + +func (o AutoScalingPolicy) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AutoScalingPolicy struct{}" + } + + return strings.Join([]string{"AutoScalingPolicy", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_auto_scaling_policy_req_v11.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_auto_scaling_policy_req_v11.go new file mode 100644 index 00000000..26fcf146 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_auto_scaling_policy_req_v11.go @@ -0,0 +1,65 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type AutoScalingPolicyReqV11 struct { + + // 弹性伸缩规则适用的节点类型,当前只支持task节点。 + NodeGroup AutoScalingPolicyReqV11NodeGroup `json:"node_group"` + + AutoScalingPolicy *AutoScalingPolicy `json:"auto_scaling_policy"` +} + +func (o AutoScalingPolicyReqV11) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "AutoScalingPolicyReqV11 struct{}" + } + + return strings.Join([]string{"AutoScalingPolicyReqV11", string(data)}, " ") +} + +type AutoScalingPolicyReqV11NodeGroup struct { + value string +} + +type AutoScalingPolicyReqV11NodeGroupEnum struct { + TASK_NODE_DEFAULT_GROUP AutoScalingPolicyReqV11NodeGroup +} + +func GetAutoScalingPolicyReqV11NodeGroupEnum() AutoScalingPolicyReqV11NodeGroupEnum { + return AutoScalingPolicyReqV11NodeGroupEnum{ + TASK_NODE_DEFAULT_GROUP: AutoScalingPolicyReqV11NodeGroup{ + value: "task_node_default_group", + }, + } +} + +func (c AutoScalingPolicyReqV11NodeGroup) Value() string { + return c.value +} + +func (c AutoScalingPolicyReqV11NodeGroup) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *AutoScalingPolicyReqV11NodeGroup) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_create_cluster_tags_req.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_create_cluster_tags_req.go new file mode 100644 index 00000000..665f4f38 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_create_cluster_tags_req.go @@ -0,0 +1,66 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type BatchCreateClusterTagsReq struct { + + // 操作标识:仅限于create(创建)。 + Action BatchCreateClusterTagsReqAction `json:"action"` + + // 标签列表。 + Tags []Tag `json:"tags"` +} + +func (o BatchCreateClusterTagsReq) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchCreateClusterTagsReq struct{}" + } + + return strings.Join([]string{"BatchCreateClusterTagsReq", string(data)}, " ") +} + +type BatchCreateClusterTagsReqAction struct { + value string +} + +type BatchCreateClusterTagsReqActionEnum struct { + CREATE BatchCreateClusterTagsReqAction +} + +func GetBatchCreateClusterTagsReqActionEnum() BatchCreateClusterTagsReqActionEnum { + return BatchCreateClusterTagsReqActionEnum{ + CREATE: BatchCreateClusterTagsReqAction{ + value: "create", + }, + } +} + +func (c BatchCreateClusterTagsReqAction) Value() string { + return c.value +} + +func (c BatchCreateClusterTagsReqAction) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *BatchCreateClusterTagsReqAction) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_create_cluster_tags_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_create_cluster_tags_request.go new file mode 100644 index 00000000..564c0227 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_create_cluster_tags_request.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type BatchCreateClusterTagsRequest struct { + + // 集群ID。获取方法,请参见[获取集群ID](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html)。 + ClusterId string `json:"cluster_id"` + + Body *BatchCreateClusterTagsReq `json:"body,omitempty"` +} + +func (o BatchCreateClusterTagsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchCreateClusterTagsRequest struct{}" + } + + return strings.Join([]string{"BatchCreateClusterTagsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_create_cluster_tags_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_create_cluster_tags_response.go new file mode 100644 index 00000000..9041af71 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_create_cluster_tags_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type BatchCreateClusterTagsResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o BatchCreateClusterTagsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchCreateClusterTagsResponse struct{}" + } + + return strings.Join([]string{"BatchCreateClusterTagsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_delete_cluster_tags_req.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_delete_cluster_tags_req.go new file mode 100644 index 00000000..5f5214c5 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_delete_cluster_tags_req.go @@ -0,0 +1,66 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type BatchDeleteClusterTagsReq struct { + + // 操作标识:仅限于delete(删除)。 + Action BatchDeleteClusterTagsReqAction `json:"action"` + + // 标签列表。 + Tags []Tag `json:"tags"` +} + +func (o BatchDeleteClusterTagsReq) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchDeleteClusterTagsReq struct{}" + } + + return strings.Join([]string{"BatchDeleteClusterTagsReq", string(data)}, " ") +} + +type BatchDeleteClusterTagsReqAction struct { + value string +} + +type BatchDeleteClusterTagsReqActionEnum struct { + DELETE BatchDeleteClusterTagsReqAction +} + +func GetBatchDeleteClusterTagsReqActionEnum() BatchDeleteClusterTagsReqActionEnum { + return BatchDeleteClusterTagsReqActionEnum{ + DELETE: BatchDeleteClusterTagsReqAction{ + value: "delete", + }, + } +} + +func (c BatchDeleteClusterTagsReqAction) Value() string { + return c.value +} + +func (c BatchDeleteClusterTagsReqAction) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *BatchDeleteClusterTagsReqAction) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_delete_cluster_tags_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_delete_cluster_tags_request.go new file mode 100644 index 00000000..eb1bd183 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_delete_cluster_tags_request.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type BatchDeleteClusterTagsRequest struct { + + // 集群ID。获取方法,请参见[获取集群ID](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html)。 + ClusterId string `json:"cluster_id"` + + Body *BatchDeleteClusterTagsReq `json:"body,omitempty"` +} + +func (o BatchDeleteClusterTagsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchDeleteClusterTagsRequest struct{}" + } + + return strings.Join([]string{"BatchDeleteClusterTagsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_delete_cluster_tags_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_delete_cluster_tags_response.go new file mode 100644 index 00000000..dd3977a5 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_batch_delete_cluster_tags_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type BatchDeleteClusterTagsResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o BatchDeleteClusterTagsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BatchDeleteClusterTagsResponse struct{}" + } + + return strings.Join([]string{"BatchDeleteClusterTagsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_bootstrap_script.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_bootstrap_script.go new file mode 100644 index 00000000..ac8daf4d --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_bootstrap_script.go @@ -0,0 +1,202 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type BootstrapScript struct { + + // 引导操作脚本的名称,同一个集群的引导操作脚本名称不允许相同。 只能由数字、英文字符、空格、中划线和下划线组成,且不能以空格开头。 可输入的字符串长度为1~64个字符。 + Name string `json:"name"` + + // 引导操作脚本的路径。设置为OBS桶的路径或虚拟机本地的路径。 - OBS桶的路径:直接手动输入脚本路径。例如输入MRS提供的公共样例脚本路径。示例:s3a://bootstrap/presto/presto-install.sh,其中安装dualroles时,presto-install.sh脚本参数为dualroles, 安装worker时,presto-install.sh脚本参数为worker。根据Presto使用习惯,建议您在Active Master节点上安装dualroles,在Core节点上安装worker。 - 虚拟机本地的路径:用户需要输入正确的脚本路径。脚本所在的路径必须以‘/’开头,以.sh结尾。 + Uri string `json:"uri"` + + // 引导操作脚本参数。 + Parameters *string `json:"parameters,omitempty"` + + // 引导操作脚本所执行的节点类型,包含master、core和task三种类型。 说明:节点类型必须为小写字母。 + Nodes []string `json:"nodes"` + + // 引导操作脚本是否只运行在主Master节点上。 缺省值为false,表示引导操作脚本可运行在所有Master节点上。 + ActiveMaster *bool `json:"active_master,omitempty"` + + // 引导操作脚本执行失败后,是否继续执行后续脚本和创建集群。 缺省值为errorout,表示终止操作。 说明: 建议您在调试阶段设置为“继续”,无论此引导操作是否执行成功,则集群都能继续安装和启动。 枚举值: - continue:继续执行后续脚本。 - errorout:终止操作。 + FailAction BootstrapScriptFailAction `json:"fail_action"` + + // 引导操作脚本执行的时间。目前支持“组件启动前”和“组件启动后”两种类型。 缺省值为false,表示引导操作脚本在组件启动后执行。 + BeforeComponentStart *bool `json:"before_component_start,omitempty"` + + // 单个引导操作脚本的执行时间。 + StartTime *int64 `json:"start_time,omitempty"` + + // 单个引导操作脚本的运行状态。 - PENDING - IN_PROGRESS - SUCCESS - FAILURE + State *BootstrapScriptState `json:"state,omitempty"` + + // 选择引导操作脚本执行的时间。 - BEFORE_COMPONENT_FIRST_START: 组件首次启动后 - AFTER_COMPONENT_FIRST_START: 组件首次启动前 - BEFORE_SCALE_IN: 缩容前 - AFTER_SCALE_IN: 缩容后 - BEFORE_SCALE_OUT: 扩容前 - AFTER_SCALE_OUT: 扩容后 + ActionStages *[]BootstrapScriptActionStages `json:"action_stages,omitempty"` +} + +func (o BootstrapScript) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "BootstrapScript struct{}" + } + + return strings.Join([]string{"BootstrapScript", string(data)}, " ") +} + +type BootstrapScriptFailAction struct { + value string +} + +type BootstrapScriptFailActionEnum struct { + CONTINUE BootstrapScriptFailAction + ERROROUT BootstrapScriptFailAction +} + +func GetBootstrapScriptFailActionEnum() BootstrapScriptFailActionEnum { + return BootstrapScriptFailActionEnum{ + CONTINUE: BootstrapScriptFailAction{ + value: "continue", + }, + ERROROUT: BootstrapScriptFailAction{ + value: "errorout", + }, + } +} + +func (c BootstrapScriptFailAction) Value() string { + return c.value +} + +func (c BootstrapScriptFailAction) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *BootstrapScriptFailAction) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type BootstrapScriptState struct { + value string +} + +type BootstrapScriptStateEnum struct { + PENDING BootstrapScriptState + IN_PROGRESS BootstrapScriptState + SUCCESS BootstrapScriptState + FAILURE BootstrapScriptState +} + +func GetBootstrapScriptStateEnum() BootstrapScriptStateEnum { + return BootstrapScriptStateEnum{ + PENDING: BootstrapScriptState{ + value: "PENDING", + }, + IN_PROGRESS: BootstrapScriptState{ + value: "IN_PROGRESS", + }, + SUCCESS: BootstrapScriptState{ + value: "SUCCESS", + }, + FAILURE: BootstrapScriptState{ + value: "FAILURE", + }, + } +} + +func (c BootstrapScriptState) Value() string { + return c.value +} + +func (c BootstrapScriptState) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *BootstrapScriptState) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type BootstrapScriptActionStages struct { + value string +} + +type BootstrapScriptActionStagesEnum struct { + BEFORE_COMPONENT_FIRST_START BootstrapScriptActionStages + AFTER_COMPONENT_FIRST_START BootstrapScriptActionStages + BEFORE_SCALE_IN BootstrapScriptActionStages + AFTER_SCALE_IN BootstrapScriptActionStages + BEFORE_SCALE_OUT BootstrapScriptActionStages + AFTER_SCALE_OUT BootstrapScriptActionStages +} + +func GetBootstrapScriptActionStagesEnum() BootstrapScriptActionStagesEnum { + return BootstrapScriptActionStagesEnum{ + BEFORE_COMPONENT_FIRST_START: BootstrapScriptActionStages{ + value: "BEFORE_COMPONENT_FIRST_START", + }, + AFTER_COMPONENT_FIRST_START: BootstrapScriptActionStages{ + value: "AFTER_COMPONENT_FIRST_START", + }, + BEFORE_SCALE_IN: BootstrapScriptActionStages{ + value: "BEFORE_SCALE_IN", + }, + AFTER_SCALE_IN: BootstrapScriptActionStages{ + value: "AFTER_SCALE_IN", + }, + BEFORE_SCALE_OUT: BootstrapScriptActionStages{ + value: "BEFORE_SCALE_OUT", + }, + AFTER_SCALE_OUT: BootstrapScriptActionStages{ + value: "AFTER_SCALE_OUT", + }, + } +} + +func (c BootstrapScriptActionStages) Value() string { + return c.value +} + +func (c BootstrapScriptActionStages) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *BootstrapScriptActionStages) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_cluster.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_cluster.go new file mode 100644 index 00000000..9945d606 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_cluster.go @@ -0,0 +1,214 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type Cluster struct { + + // 集群ID。 + ClusterId *string `json:"clusterId,omitempty"` + + // 集群名称。 + ClusterName *string `json:"clusterName,omitempty"` + + // 集群部署的节点总数。 + TotalNodeNum *string `json:"totalNodeNum,omitempty"` + + // 集群状态,包括: - starting:启动中的集群。 - running:运行中的集群。 - terminated:已删除的集群。 - failed:失败的集群。 - abnormal:异常的集群。 - terminating:删除中的集群。 - frozen:已冻结的集群。 - scaling-out:扩容中的集群。 - scaling-in:缩容中的集群。 + ClusterState *string `json:"clusterState,omitempty"` + + // 集群进度描述。 安装集群进度包括: - Verifying cluster parameters:校验集群参数中 - Applying for cluster resources:申请集群资源中 - Creating VM:创建虚拟机中 - Initializing VM:初始化虚拟机中 - Installing MRS Manager:安装MRS Manager中 - Deploying cluster:部署集群中 - Cluster installation failed:集群安装失败 扩容集群进度包括: - Preparing for cluster expansion:准备扩容中 - Creating VM:创建虚拟机中 - Initializing VM:初始化虚拟机中 - Adding node to the cluster:节点加入集群中 - Cluster expansion failed:集群扩容失败 缩容集群进度包括: - Preparing for cluster shrink:正在准备缩容 - Decommissioning instance:实例退服中 - Deleting VM:删除虚拟机中 - Deleting node from the cluster:从集群删除节点中 - Cluster shrink failed:集群缩容失败 集群安装、扩容、缩容失败,stageDesc会显示失败的原因。 + StageDesc *string `json:"stageDesc,omitempty"` + + // 集群创建时间,十位时间戳。 + CreateAt *string `json:"createAt,omitempty"` + + // 集群更新时间,十位时间戳。 + UpdateAt *string `json:"updateAt,omitempty"` + + // 开始计费时间。 + ChargingStartTime *string `json:"chargingStartTime,omitempty"` + + // 集群计费模式。 + BillingType *string `json:"billingType,omitempty"` + + // 集群工作区域。 + DataCenter *string `json:"dataCenter,omitempty"` + + // VPC名称。 + Vpc *string `json:"vpc,omitempty"` + + // VPC ID。 + VpcId *string `json:"vpcId,omitempty"` + + // 集群购买时长。 + Duration *string `json:"duration,omitempty"` + + // 创建集群所需费用,系统自动计算。 + Fee *string `json:"fee,omitempty"` + + // Hadoop组件版本信息。 + HadoopVersion *string `json:"hadoopVersion,omitempty"` + + // 组件列表信息。 + ComponentList *[]ComponentAmb `json:"componentList,omitempty"` + + // 公网IP地址。 + ExternalIp *string `json:"externalIp,omitempty"` + + // 公网备用IP地址。 + ExternalAlternateIp *string `json:"externalAlternateIp,omitempty"` + + // 内网IP地址。 + InternalIp *string `json:"internalIp,omitempty"` + + // 集群部署ID。 + DeploymentId *string `json:"deploymentId,omitempty"` + + // 集群备注信息。 + Remark *string `json:"remark,omitempty"` + + // 创建集群的订单号。 + OrderId *string `json:"orderId,omitempty"` + + // 可用区域ID。 + AzId *string `json:"azId,omitempty"` + + // 可用区域名称。 + AzName *string `json:"azName,omitempty"` + + // 可用区域英文名称 + AzCode *string `json:"azCode,omitempty"` + + // 可用区域 + AvailabilityZoneId *string `json:"availabilityZoneId,omitempty"` + + // 实例ID。 + InstanceId *string `json:"instanceId,omitempty"` + + // 远程登录弹性云服务器的URI地址。 + Vnc *string `json:"vnc,omitempty"` + + // 项目编号。 + TenantId *string `json:"tenantId,omitempty"` + + // 磁盘存储空间。 + VolumeSize *int32 `json:"volumeSize,omitempty"` + + // 磁盘类型。 + VolumeType *string `json:"volumeType,omitempty"` + + // 子网ID。 + SubnetId *string `json:"subnetId,omitempty"` + + // 子网名称。 + SubnetName *string `json:"subnetName,omitempty"` + + // 安全组ID。 + SecurityGroupsId *string `json:"securityGroupsId,omitempty"` + + // 非Master节点的安全组id,当前一个MRS集群只会使用一个安全组,所以该字段已经废弃,从兼容性考虑,该字段会返回和securityGroupsId同样的值。 + SlaveSecurityGroupsId *string `json:"slaveSecurityGroupsId,omitempty"` + + // 配置引导操作脚本信息。 + BootstrapScripts *[]BootstrapScript `json:"bootstrapScripts,omitempty"` + + // MRS集群运行模式。 - 0:普通集群 - 1:安全集群 + SafeMode *int32 `json:"safeMode,omitempty"` + + // 集群版本。 + ClusterVersion *string `json:"clusterVersion,omitempty"` + + // 密钥文件名称。 + NodePublicCertName *string `json:"nodePublicCertName,omitempty"` + + // Master节点IP。 + MasterNodeIp *string `json:"masterNodeIp,omitempty"` + + // 首选私有IP。 + PrivateIpFirst *string `json:"privateIpFirst,omitempty"` + + // 错误信息。 + ErrorInfo *string `json:"errorInfo,omitempty"` + + // 标签信息 + Tags *string `json:"tags,omitempty"` + + // 集群部署的Master节点数量。 + MasterNodeNum *string `json:"masterNodeNum,omitempty"` + + // 集群部署的Core节点数量。 + CoreNodeNum *string `json:"coreNodeNum,omitempty"` + + // Master节点的实例规格。 + MasterNodeSize *string `json:"masterNodeSize,omitempty"` + + // Core节点的实例规格。 + CoreNodeSize *string `json:"coreNodeSize,omitempty"` + + // Master节点产品ID。 + MasterNodeProductId *string `json:"masterNodeProductId,omitempty"` + + // Master节点规格ID。 + MasterNodeSpecId *string `json:"masterNodeSpecId,omitempty"` + + // Core节点产品ID。 + CoreNodeProductId *string `json:"coreNodeProductId,omitempty"` + + // Core节点规格ID。 + CoreNodeSpecId *string `json:"coreNodeSpecId,omitempty"` + + // Master节点数据磁盘存储类别,目前支持SATA、SAS和SSD。 + MasterDataVolumeType *string `json:"masterDataVolumeType,omitempty"` + + // Master节点数据磁盘存储空间。为增大数据存储容量,创建集群时可同时添加磁盘。 取值范围:100GB~32000GB,传值只需填数字,不需要带单位GB。 + MasterDataVolumeSize *int32 `json:"masterDataVolumeSize,omitempty"` + + // Master节点数据磁盘个数。 取值只能是1 + MasterDataVolumeCount *int32 `json:"masterDataVolumeCount,omitempty"` + + // Core节点数据磁盘存储类别,目前支持SATA、SAS和SSD。 + CoreDataVolumeType *string `json:"coreDataVolumeType,omitempty"` + + // Core节点数据磁盘存储空间。为增大数据存储容量,创建集群时可同时添加磁盘。 取值范围:100GB~32000GB,传值只需填数字,不需要带单位GB。 + CoreDataVolumeSize *int32 `json:"coreDataVolumeSize,omitempty"` + + // Core节点数据磁盘个数。 取值范围:1~10 + CoreDataVolumeCount *int32 `json:"coreDataVolumeCount,omitempty"` + + // 企业项目ID。 + EnterpriseProjectId *string `json:"enterpriseProjectId,omitempty"` + + // 表示集群创建过程中,MRS Manager是否安装完成。 - true:安装完成 - false:安装未完成 + IsMrsManagerFinish *bool `json:"isMrsManagerFinish,omitempty"` + + // 集群类型。 + ClusterType *int32 `json:"clusterType,omitempty"` + + // 集群安装失败时,是否搜集日志。 - 0:不收集 - 1:收集 + LogCollection *int32 `json:"logCollection,omitempty"` + + // 区分包周期,集群是包年还是包月。 - 0:包月 - 1:包年 + PeriodType *int32 `json:"periodType,omitempty"` + + // 集群节点的变更状态(扩容/缩容/变更规格)。当该参数取值为空时,表示集群节点没有进行变更操作。 取值范围: - scaling-out:扩容中 - scaling-in:缩容中 - scaling-error:处于running状态,且上一次扩容/缩容/升级规格失败的集群 - scaling-up:Master节点规格升级中 - scaling_up_first:备Master节点规格升级中 - scaled_up_first:备Master节点规格升级成功 - scaled-up-success:Master节点规格升级成功 + Scale *string `json:"scale,omitempty"` + + // Master节点、Core节点和Task节点列表信息。 + NodeGroups *[]NodeGroupV10 `json:"nodeGroups,omitempty"` + + // Task节点列表信息。 + TaskNodeGroups *[]NodeGroupV10 `json:"taskNodeGroups,omitempty"` +} + +func (o Cluster) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Cluster struct{}" + } + + return strings.Join([]string{"Cluster", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_cluster_scaling_params.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_cluster_scaling_params.go new file mode 100644 index 00000000..0e95ef3f --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_cluster_scaling_params.go @@ -0,0 +1,90 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type ClusterScalingParams struct { + + // 扩容/缩容时系统获取的订单号,用户不需要配置。 + OrderId *string `json:"order_id,omitempty"` + + // - scale_in:缩容 - scale_out:扩容 + ScaleType ClusterScalingParamsScaleType `json:"scale_type"` + + // 扩容/缩容时新增或者减少节点的ID标识,参数值固定为node_orderadd。 + NodeId string `json:"node_id"` + + // 扩容或缩容的节点组。 - 如果node_group为core_node_default_group,表示Core节点组。 - 如果node_group为task_node_default_group,表示Task节点组。 该字段可以为空,为空时,系统默认值为core_node_default_group。 + NodeGroup *string `json:"node_group,omitempty"` + + // 是否跳过引导操作,默认为false,即执行引导操作。 仅在创建集群时配置了引导操作且扩容时有意义,表示扩容时是否在新增节点上执行创建集群时指定的引导操作。 + SkipBootstrapScripts *string `json:"skip_bootstrap_scripts,omitempty"` + + // 扩容后是否启动扩容节点上的组件。 - true:扩容后不启动组件。 - false:扩容后启动组件。 + ScaleWithoutStart *bool `json:"scale_without_start,omitempty"` + + // 缩容Task节点时指定待删除Task节点的ID列表。 - 当scale_type为扩容时,该参数不生效。 - 当scale_type为缩容且该参数不为空时,删除指定的Task节点。 - 当scale_type为缩容且server_ids为空时,按照系统规则自动选择删除Task节点。 + ServerIds *[]string `json:"server_ids,omitempty"` + + // 扩容或缩容的节点数。 - 扩容时的最大节点数为(500 - 集群Core/Task节点数)。例如,当前集群Core节点数为3,此处扩容的节点数必须小于等于497。 Core和Task节点总数最大值为500,如果用户需要的Core/Task节点数大于500,可以联系技术支持人员或者调用后台接口修改数据库。 - 缩容时Core节点数大于3或者Task节点数大于0可以进行节点删除。例如,当前集群Core节点和Task节点数均为5,Core节点可缩容的节点数为2(5减去3),Task节点可缩容节点数为小于等于5。 + Instances int32 `json:"instances"` + + TaskNodeInfo *TaskNodeInfo `json:"task_node_info,omitempty"` +} + +func (o ClusterScalingParams) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ClusterScalingParams struct{}" + } + + return strings.Join([]string{"ClusterScalingParams", string(data)}, " ") +} + +type ClusterScalingParamsScaleType struct { + value string +} + +type ClusterScalingParamsScaleTypeEnum struct { + SCALE_IN ClusterScalingParamsScaleType + SCALE_OUT ClusterScalingParamsScaleType +} + +func GetClusterScalingParamsScaleTypeEnum() ClusterScalingParamsScaleTypeEnum { + return ClusterScalingParamsScaleTypeEnum{ + SCALE_IN: ClusterScalingParamsScaleType{ + value: "scale_in", + }, + SCALE_OUT: ClusterScalingParamsScaleType{ + value: "scale_out", + }, + } +} + +func (c ClusterScalingParamsScaleType) Value() string { + return c.value +} + +func (c ClusterScalingParamsScaleType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ClusterScalingParamsScaleType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_cluster_scaling_req.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_cluster_scaling_req.go new file mode 100644 index 00000000..caf76243 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_cluster_scaling_req.go @@ -0,0 +1,30 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type ClusterScalingReq struct { + + // 服务ID,为扩展接口,预留此参数。用户不需要配置。 + ServiceId *string `json:"service_id,omitempty"` + + // 套餐ID,为扩展接口,预留此参数。用户不需要配置。 + PlanId *string `json:"plan_id,omitempty"` + + Parameters *ClusterScalingParams `json:"parameters"` + + // 扩展接口,预留此参数。用户不需要配置。 + PreviousValues map[string]string `json:"previous_values,omitempty"` +} + +func (o ClusterScalingReq) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ClusterScalingReq struct{}" + } + + return strings.Join([]string{"ClusterScalingReq", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_component_amb.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_component_amb.go new file mode 100644 index 00000000..c33a26be --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_component_amb.go @@ -0,0 +1,31 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type ComponentAmb struct { + + // 组件ID。 + ComponentId *string `json:"componentId,omitempty"` + + // 组件名称。 + ComponentName *string `json:"componentName,omitempty"` + + // 组件版本。 + ComponentVersion *string `json:"componentVersion,omitempty"` + + // 组件描述信息。 + ComponentDesc *string `json:"componentDesc,omitempty"` +} + +func (o ComponentAmb) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ComponentAmb struct{}" + } + + return strings.Join([]string{"ComponentAmb", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_component_amb_v11.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_component_amb_v11.go new file mode 100644 index 00000000..087dd6f7 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_component_amb_v11.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type ComponentAmbV11 struct { + + // 组件名称 + ComponentName string `json:"component_name"` +} + +func (o ComponentAmbV11) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ComponentAmbV11 struct{}" + } + + return strings.Join([]string{"ComponentAmbV11", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_and_execute_job_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_and_execute_job_request.go new file mode 100644 index 00000000..6b2655e2 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_and_execute_job_request.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type CreateAndExecuteJobRequest struct { + Body *SubmitJobReqV11 `json:"body,omitempty"` +} + +func (o CreateAndExecuteJobRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateAndExecuteJobRequest struct{}" + } + + return strings.Join([]string{"CreateAndExecuteJobRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_and_execute_job_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_and_execute_job_response.go new file mode 100644 index 00000000..83cefa85 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_and_execute_job_response.go @@ -0,0 +1,150 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type CreateAndExecuteJobResponse struct { + + // 作业执行对象是否由作业模板生成。 + Templated *bool `json:"templated,omitempty"` + + // 作业创建时间,十位时间戳。 + CreatedAt *int64 `json:"created_at,omitempty"` + + // 作业更新时间,十位时间戳。 + UpdatedAt *int64 `json:"updated_at,omitempty"` + + // 作业ID。 + Id *string `json:"id,omitempty"` + + // 项目编号。获取方法,请参见[获取项目ID](https://support.huaweicloud.com/api-mrs/mrs_02_0011.html)。 + TenantId *string `json:"tenant_id,omitempty"` + + // 作业应用ID。 + JobId *string `json:"job_id,omitempty"` + + // 作业名称,只能由字母、数字、中划线和下划线组成,并且长度为1~64个字符。 说明: 不同作业的名称允许相同,但不建议设置相同。 + JobName *string `json:"job_name,omitempty"` + + // 数据输入ID。 + InputId *string `json:"input_id,omitempty"` + + // 数据输出ID。 + OutputId *string `json:"output_id,omitempty"` + + // 作业执行开始时间,十位时间戳。 + StartTime *int64 `json:"start_time,omitempty"` + + // 作业执行结束时间,十位时间戳。 + EndTime *int64 `json:"end_time,omitempty"` + + // 集群ID。 + ClusterId *string `json:"cluster_id,omitempty"` + + // Oozie工作流ID。 + EngineJobId *string `json:"engine_job_id,omitempty"` + + // 运行结果返回码。 + ReturnCode *string `json:"return_code,omitempty"` + + // 是否公开。 当前版本不支持该功能。 + IsPublic *bool `json:"is_public,omitempty"` + + // 是否受保护。 当前版本不支持该功能。 + IsProtected *bool `json:"is_protected,omitempty"` + + // 作业执行组ID。 + GroupId *string `json:"group_id,omitempty"` + + // 执行程序Jar包或sql文件地址,需要满足如下要求: - 最多为1023字符,不能包含;|&><'$特殊字符,且不可为空或全空格。 - 需要以“/”或“s3a://”开头。OBS路径不支持KMS加密的文件或程序。 - Spark Script需要以“.sql”结尾,MapReduce和Spark Jar需要以“.jar”结尾,sql和jar不区分大小写。 + JarPath *string `json:"jar_path,omitempty"` + + // 数据输入地址,必须以“/”或“s3a://”开头。请配置为正确的OBS路径,OBS路径不支持KMS加密的文件或程序。 最多为1023字符,不能包含;|&>'<$特殊字符,可为空。 + Input *string `json:"input,omitempty"` + + // 数据输出地址,必须以“/”或“s3a://”开头。请配置为正确的OBS路径,如果该路径不存在,系统会自动创建。 最多为1023字符,不能包含;|&>'<$特殊字符,可为空。 + Output *string `json:"output,omitempty"` + + // 作业日志存储地址,该日志信息记录作业运行状态。必须以“/”或“s3a://”开头,请配置为正确的OBS路径。 最多为1023字符,不能包含;|&>'<$特殊字符,可为空。 + JobLog *string `json:"job_log,omitempty"` + + // 作业类型码。 - 1:MapReduce - 2:Spark - 3:Hive Script - 4:HiveSQL(当前不支持) - 5:DistCp,导入、导出数据。 - 6:Spark Script - 7:Spark SQL,提交SQL语句,(该接口当前不支持) 说明: 只有包含Spark和Hive组件的集群才能新增Spark和Hive类型的作业。 + JobType *int32 `json:"job_type,omitempty"` + + // 文件操作类型,包括: - export:从HDFS导出数据至OBS - import:从OBS导入数据至HDFS + FileAction *string `json:"file_action,omitempty"` + + // 程序执行的关键参数,该参数由用户程序内的函数指定,MRS只负责参数的传入。 最多为150000字符,不能包含;|&>'<$!\\\"\\特殊字符,可为空。 说明: 用户输入带有敏感信息(如登录密码)的参数时,可通过在参数名前添加“@”的方式,为该参数值加密,以防止敏感信息被明文形式持久化。在查看作业信息时,敏感信息显示为“*”。 例如:username=admin @password=admin_123 + Arguments *string `json:"arguments,omitempty"` + + // Hive&Spark Sql语句 + Hql *string `json:"hql,omitempty"` + + // 作业状态码。 - 1:Terminated - 2:Starting - 3:Running - 4:Completed - 5:Abnormal - 6:Error + JobState *int32 `json:"job_state,omitempty"` + + // 作业最终状态码。 - 0:未完成 - 1:执行错误,终止执行 - 2:执行完成并且成功 - 3:已取消 + JobFinalStatus *int32 `json:"job_final_status,omitempty"` + + // sql程序路径,仅Spark Script和Hive Script作业需要使用此参数。需要满足如下要求: - 最多为1023字符,不能包含;|&><'$特殊字符,且不可为空或全空格。 - 需要以“/”或“s3a://”开头,OBS路径不支持KMS加密的文件或程序。 - 需要以“.sql”结尾,sql不区分大小写。 + HiveScriptPath *string `json:"hive_script_path,omitempty"` + + // 创建作业的用户ID。 为兼容历史版本,保留此参数。 + CreateBy *string `json:"create_by,omitempty"` + + // 当前已完成的步骤数。 为兼容历史版本,保留此参数。 + FinishedStep *int32 `json:"finished_step,omitempty"` + + // 作业主ID。 为兼容历史版本,保留此参数。 + JobMainId *string `json:"job_main_id,omitempty"` + + // 作业步骤ID。 为兼容历史版本,保留此参数。 + JobStepId *string `json:"job_step_id,omitempty"` + + // 延迟时间,十位时间戳。 为兼容历史版本,保留此参数。 + PostponeAt *int64 `json:"postpone_at,omitempty"` + + // 作业步骤名。 为兼容历史版本,保留此参数。 + StepName *string `json:"step_name,omitempty"` + + // 步骤数量 为兼容历史版本,保留此参数。 + StepNum *int32 `json:"step_num,omitempty"` + + // 任务数量。为兼容历史版本,保留此参数。 + TaskNum *int32 `json:"task_num,omitempty"` + + // 更新作业的用户ID。 + UpdateBy *string `json:"update_by,omitempty"` + + // 令牌,当前版本不支持。 + Credentials *string `json:"credentials,omitempty"` + + // 创建作业的用户ID。 历史版本兼容,不再使用。 + UserId *string `json:"user_id,omitempty"` + + // 键值对集合,用于保存作业运行配置。 + JobConfigs map[string]interface{} `json:"job_configs,omitempty"` + + // 认证信息,当前版本不支持。 + Extra map[string]interface{} `json:"extra,omitempty"` + + // 数据源URL。 + DataSourceUrls map[string]interface{} `json:"data_source_urls,omitempty"` + + // 键值对集合,包含oozie返回的作业运行信息。 + Info map[string]interface{} `json:"info,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o CreateAndExecuteJobResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateAndExecuteJobResponse struct{}" + } + + return strings.Join([]string{"CreateAndExecuteJobResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_req_v11.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_req_v11.go new file mode 100644 index 00000000..4beb9987 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_req_v11.go @@ -0,0 +1,520 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type CreateClusterReqV11 struct { + + // 集群版本。 例如:MRS 3.1.0。 + ClusterVersion string `json:"cluster_version"` + + // 集群名称,不允许相同。 只能由字母、数字、中划线和下划线组成,并且长度为1~64个字符。 + ClusterName string `json:"cluster_name"` + + // Master节点数量。启用集群高可用功能时配置为2,不启用集群高可用功能时配置为1。MRS 3.x版本暂时不支持该参数配置为1。 + MasterNodeNum int32 `json:"master_node_num"` + + // Core节点数量。 取值范围:[1~500] Core节点默认的最大值为500,如果用户需要的Core节点数大于500,请申请扩大配额。 + CoreNodeNum int32 `json:"core_node_num"` + + // 集群的计费模式。 12:表示按需计费。接口调用仅支持创建按需计费集群。 + BillingType CreateClusterReqV11BillingType `json:"billing_type"` + + // 集群区域信息,请参见[终端节点及区域](https://support.huaweicloud.com/api-mrs/mrs_02_0003.html)。 + DataCenter string `json:"data_center"` + + // 子网所在VPC名称。 通过VPC管理控制台获取名称: 1) 登录管理控制台。 2) 单击“虚拟私有云”,从左侧列表选择虚拟私有云。 在“虚拟私有云”页面的列表中即可获取VPC名称。 + Vpc string `json:"vpc"` + + // Master节点的实例规格,例如:c3.4xlarge.2.linux.bigdata。MRS当前支持主机规格的配型由CPU+内存+Disk共同决定。实例规格详细说明请参见[MRS所使用的弹性云服务器规格](https://support.huaweicloud.com/api-mrs/mrs_01_9006.html)和[MRS所使用的裸金属服务器规格](https://support.huaweicloud.com/api-mrs/mrs_01_9001.html)。 该参数建议从MRS控制台的集群创建页面获取对应区域对应版本所支持的规格。 + MasterNodeSize string `json:"master_node_size"` + + // Core节点的实例规格,例如:c3.4xlarge.2.linux.bigdata。实例规格详细说明请参见[MRS所使用的弹性云服务器规格](https://support.huaweicloud.com/api-mrs/mrs_01_9006.html)和[MRS所使用的裸金属服务器规格](https://support.huaweicloud.com/api-mrs/mrs_01_9001.html)。 该参数建议从MRS控制台的集群创建页面获取对应区域对应版本所支持的规格。 + CoreNodeSize string `json:"core_node_size"` + + // 服务组件安装列表信息。 + ComponentList []ComponentAmbV11 `json:"component_list"` + + // 可用分区ID。 - 华北-北京一可用区1(cn-north-1a):ae04cf9d61544df3806a3feeb401b204 - 华北-北京一可用区2(cn-north-1b):d573142f24894ef3bd3664de068b44b0 - 华东-上海二可用区1(cn-east-2a):72d50cedc49846b9b42c21495f38d81c - 华东-上海二可用区2(cn-east-2b):38b0f7a602344246bcb0da47b5d548e7 - 华东-上海二可用区3(cn-east-2c):5547fd6bf8f84bb5a7f9db062ad3d015 - 华南-广州可用区1(cn-south-1a):34f5ff4865cf4ed6b270f15382ebdec5 - 华南-广州可用区2(cn-south-2b):043c7e39ecb347a08dc8fcb6c35a274e - 华南-广州可用区3(cn-south-1c):af1687643e8c4ec1b34b688e4e3b8901 - 华北-北京四可用区1(cn-north-4a):effdcbc7d4d64a02aa1fa26b42f56533 - 华北-北京四可用区2(cn-north-4b):a0865121f83b41cbafce65930a22a6e8 - 华北-北京四可用区3(cn-north-4c):2dcb154ac2724a6d92e9bcc859657c1e + AvailableZoneId string `json:"available_zone_id"` + + // 子网所在VPC ID。 通过VPC管理控制台获取ID: 1) 登录管理控制台。 2) 单击“虚拟私有云”,从左侧列表选择虚拟私有云。 在“虚拟私有云”页面的列表中即可获取VPC ID。 + VpcId string `json:"vpc_id"` + + // 子网ID。通过VPC管理控制台获取子网ID: 1) 登录管理控制台。 2) 单击“虚拟私有云”,从左侧列表选择虚拟私有云。 3) 单击对应虚拟私有云所在行的“子网个数”查看子网。 4) 单击对应子网名称,获取“网络ID”。 “subnet_id”和“subnet_name”必须至少填写一个,当这两个参数同时配置但是不匹配同一个子网时,集群会创建失败,请仔细填写参数。推荐使用“subnet_id”。 + SubnetId string `json:"subnet_id"` + + // 子网名称。 通过VPC管理控制台获取子网名称: 1) 登录管理控制台。 2) 单击“虚拟私有云”,从左侧列表选择虚拟私有云。 3) 单击对应虚拟私有云所在行的“子网个数”查看子网,获取子网名称。 “subnet_id”和“subnet_name”必须至少填写一个,当这两个参数同时配置但是不匹配同一个子网时,集群会创建失败,请仔细填写参数。当仅填写“subnet_name”一个参数且VPC下存在同名子网时,创建集群时以VPC平台第一个名称的子网为准。推荐使用“subnet_id”。 + SubnetName string `json:"subnet_name"` + + // 集群安全组的ID。 - 当该ID为空时MRS后台会自己创建安全组,自动创建的安全组名称以mrs_{cluster_name}开头。 - 当该ID不为空时,表示使用固定安全组来创建集群,传入的ID必须是当前租户中包含的安全组ID,且该安全组中包含一条全部协议,全部端口,源地址为指定的管理面节点IP的入方向规则。 + SecurityGroupsId *string `json:"security_groups_id,omitempty"` + + // 创建集群时可同时提交作业,当前版本暂时只支持新增一个作业。 + AddJobs *[]AddJobsReqV11 `json:"add_jobs,omitempty"` + + // Master和Core节点数据磁盘存储空间。为增大数据存储容量,创建集群时可同时添加磁盘。可以根据如下应用场景合理选择磁盘存储空间大小: - 数据存储和计算分离,数据存储在OBS系统中,集群费用相对较低,计算性能不高,并且集群随时可以删除,建议数据计算不频繁场景下使用。 - 数据存储和计算不分离,数据存储在HDFS中,集群费用相对较高,计算性能高,集群需要长期存在,建议数据计算频繁场景下使用。 取值范围:100GB~32000GB,传值只需填数字,不需要带单位GB。 不建议使用该参数,详情请参考volume_type参数的说明。 + VolumeSize *int32 `json:"volume_size,omitempty"` + + // Master和Core节点的磁盘存储类别,目前支持SATA、SAS、SSD和GPSSD。磁盘参数可以使用volume_type和volume_size表示,也可以使用多磁盘相关的参数表示。volume_type和volume_size这两个参数如果与多磁盘参数同时出现,系统优先读取volume_type和volume_size参数。建议使用多磁盘参数。 - SATA:普通IO - SAS:高IO - SSD:超高IO - GPSSD:通用型SSD + VolumeType *CreateClusterReqV11VolumeType `json:"volume_type,omitempty"` + + // 该参数为多磁盘参数,表示Master节点数据磁盘存储类别,目前支持SATA、SAS、SSD和GPSSD。 + MasterDataVolumeType *CreateClusterReqV11MasterDataVolumeType `json:"master_data_volume_type,omitempty"` + + // 该参数为多磁盘参数,表示Master节点数据磁盘存储空间。为增大数据存储容量,创建集群时可同时添加磁盘。 取值范围:100GB~32000GB,传值只需填数字,不需要带单位GB。 + MasterDataVolumeSize *int32 `json:"master_data_volume_size,omitempty"` + + // 该参数为多磁盘参数,表示Master节点数据磁盘个数。取值只能是1。 + MasterDataVolumeCount *CreateClusterReqV11MasterDataVolumeCount `json:"master_data_volume_count,omitempty"` + + // 该参数为多磁盘参数,表示Core节点数据磁盘存储类别,目前支持SATA、SAS、SSD和GPSSD。 + CoreDataVolumeType *CreateClusterReqV11CoreDataVolumeType `json:"core_data_volume_type,omitempty"` + + // 该参数为多磁盘参数,表示Core节点数据磁盘存储空间。为增大数据存储容量,创建集群时可同时添加磁盘。 取值范围:100GB~32000GB,传值只需填数字,不需要带单位GB。 + CoreDataVolumeSize *int32 `json:"core_data_volume_size,omitempty"` + + // 该参数为多磁盘参数,表示Core节点数据磁盘个数。 取值范围:1~10 + CoreDataVolumeCount *int32 `json:"core_data_volume_count,omitempty"` + + // Task节点列表信息。 + TaskNodeGroups *[]TaskNodeGroup `json:"task_node_groups,omitempty"` + + // 配置引导操作脚本信息。 + BootstrapScripts *[]BootstrapScript `json:"bootstrap_scripts,omitempty"` + + // 密钥对名称。用户可以使用密钥对方式登录集群节点。当“login_mode”配置为“1”时,请求消息体中包含node_public_cert_name字段。 + NodePublicCertName *string `json:"node_public_cert_name,omitempty"` + + // 配置MRS Manager管理员用户的密码。 - 密码长度应在8~26个字符之间 - 不能与用户名或者倒序用户名相同 - 必须包含如下4种字符的组合 - 至少一个小写字母 - 至少一个大写字母 - 至少一个数字 - 至少一个特殊字符:!@$%^-_=+[{}]:,./? + ClusterAdminSecret *string `json:"cluster_admin_secret,omitempty"` + + // 配置访问集群节点的root密码。当“login_mode”配置为“0”时,请求消息体中包含cluster_master_secret字段。 密码设置约束如下: - 字符串类型,可输入的字符串长度为8-26。 - 至少包含4种字符组合,如大写字母,小写字母,数字,特殊字符(!@$%^-_=+[{}]:,./?),但不能包含空格。 - 不能与用户名或者倒序用户名相同。 + ClusterMasterSecret string `json:"cluster_master_secret"` + + // MRS集群运行模式。 - 0:普通集群,表示Kerberos认证关闭,用户可使用集群提供的所有功能。 - 1:安全集群,表示Kerberos认证开启,普通用户无权限使用MRS集群的“文件管理”和“作业管理”功能,并且无法查看Hadoop、Spark的作业记录以及集群资源使用情况。如果需要使用集群更多功能,需要找MRS Manager的管理员分配权限。 + SafeMode CreateClusterReqV11SafeMode `json:"safe_mode"` + + // 集群类型。 默认值为0:分析集群。 说明:暂不支持通过接口方式创建混合集群。 枚举值: - 0:分析集群 - 1:流式集群 + ClusterType *CreateClusterReqV11ClusterType `json:"cluster_type,omitempty"` + + // 集群创建失败时,是否收集失败日志。 默认设置为1,将创建OBS桶仅用于MRS集群创建失败时的日志收集。 枚举值: - 0:不收集 - 1:收集 + LogCollection *CreateClusterReqV11LogCollection `json:"log_collection,omitempty"` + + // 企业项目ID。 创建集群时,给集群绑定企业项目ID。 默认设置为0,表示为default企业项目。 获取方式请参见《企业管理API参考》的“查询企业项目列表”响应消息表“enterprise_project字段数据结构说明”的“id”。 + EnterpriseProjectId *string `json:"enterprise_project_id,omitempty"` + + // 集群的标签信息。 同一个集群最多能使用10个tag,tag的名称(key)不能重复 标签的键/值不能包含“=”,“*”,“<”,“>”,“\\”,“,”,“|”,“/”。 + Tags *[]Tag `json:"tags,omitempty"` + + // 集群登录方式。默认设置为1。 - 当“login_mode”配置为“0”时,请求消息体中包含cluster_master_secret字段。 - 当“login_mode”配置为“1”时,请求消息体中包含node_public_cert_name字段。 枚举值: - 0:密码方式 - 1:密钥对方式 + LoginMode *CreateClusterReqV11LoginMode `json:"login_mode,omitempty"` + + // 节点列表信息。 说明:如下参数和该参数任选一组进行配置即可。 master_node_num、master_node_size、core_node_num、core_node_size、master_data_volume_type、master_data_volume_size、master_data_volume_count、core_data_volume_type、core_data_volume_size、core_data_volume_count、volume_type、volume_size、task_node_groups。 + NodeGroups *[]NodeGroupV11 `json:"node_groups,omitempty"` +} + +func (o CreateClusterReqV11) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateClusterReqV11 struct{}" + } + + return strings.Join([]string{"CreateClusterReqV11", string(data)}, " ") +} + +type CreateClusterReqV11BillingType struct { + value int32 +} + +type CreateClusterReqV11BillingTypeEnum struct { + E_12 CreateClusterReqV11BillingType +} + +func GetCreateClusterReqV11BillingTypeEnum() CreateClusterReqV11BillingTypeEnum { + return CreateClusterReqV11BillingTypeEnum{ + E_12: CreateClusterReqV11BillingType{ + value: 12, + }, + } +} + +func (c CreateClusterReqV11BillingType) Value() int32 { + return c.value +} + +func (c CreateClusterReqV11BillingType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateClusterReqV11BillingType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("int32") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(int32) + return nil + } + return err + } else { + return errors.New("convert enum data to int32 error") + } +} + +type CreateClusterReqV11VolumeType struct { + value string +} + +type CreateClusterReqV11VolumeTypeEnum struct { + SATA CreateClusterReqV11VolumeType + SAS CreateClusterReqV11VolumeType + SSD CreateClusterReqV11VolumeType + GPSSD CreateClusterReqV11VolumeType +} + +func GetCreateClusterReqV11VolumeTypeEnum() CreateClusterReqV11VolumeTypeEnum { + return CreateClusterReqV11VolumeTypeEnum{ + SATA: CreateClusterReqV11VolumeType{ + value: "SATA", + }, + SAS: CreateClusterReqV11VolumeType{ + value: "SAS", + }, + SSD: CreateClusterReqV11VolumeType{ + value: "SSD", + }, + GPSSD: CreateClusterReqV11VolumeType{ + value: "GPSSD", + }, + } +} + +func (c CreateClusterReqV11VolumeType) Value() string { + return c.value +} + +func (c CreateClusterReqV11VolumeType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateClusterReqV11VolumeType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type CreateClusterReqV11MasterDataVolumeType struct { + value string +} + +type CreateClusterReqV11MasterDataVolumeTypeEnum struct { + SATA CreateClusterReqV11MasterDataVolumeType + SAS CreateClusterReqV11MasterDataVolumeType + SSD CreateClusterReqV11MasterDataVolumeType + GPSSD CreateClusterReqV11MasterDataVolumeType +} + +func GetCreateClusterReqV11MasterDataVolumeTypeEnum() CreateClusterReqV11MasterDataVolumeTypeEnum { + return CreateClusterReqV11MasterDataVolumeTypeEnum{ + SATA: CreateClusterReqV11MasterDataVolumeType{ + value: "SATA", + }, + SAS: CreateClusterReqV11MasterDataVolumeType{ + value: "SAS", + }, + SSD: CreateClusterReqV11MasterDataVolumeType{ + value: "SSD", + }, + GPSSD: CreateClusterReqV11MasterDataVolumeType{ + value: "GPSSD", + }, + } +} + +func (c CreateClusterReqV11MasterDataVolumeType) Value() string { + return c.value +} + +func (c CreateClusterReqV11MasterDataVolumeType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateClusterReqV11MasterDataVolumeType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type CreateClusterReqV11MasterDataVolumeCount struct { + value int32 +} + +type CreateClusterReqV11MasterDataVolumeCountEnum struct { + E_1 CreateClusterReqV11MasterDataVolumeCount +} + +func GetCreateClusterReqV11MasterDataVolumeCountEnum() CreateClusterReqV11MasterDataVolumeCountEnum { + return CreateClusterReqV11MasterDataVolumeCountEnum{ + E_1: CreateClusterReqV11MasterDataVolumeCount{ + value: 1, + }, + } +} + +func (c CreateClusterReqV11MasterDataVolumeCount) Value() int32 { + return c.value +} + +func (c CreateClusterReqV11MasterDataVolumeCount) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateClusterReqV11MasterDataVolumeCount) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("int32") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(int32) + return nil + } + return err + } else { + return errors.New("convert enum data to int32 error") + } +} + +type CreateClusterReqV11CoreDataVolumeType struct { + value string +} + +type CreateClusterReqV11CoreDataVolumeTypeEnum struct { + SATA CreateClusterReqV11CoreDataVolumeType + SAS CreateClusterReqV11CoreDataVolumeType + SSD CreateClusterReqV11CoreDataVolumeType + GPSSD CreateClusterReqV11CoreDataVolumeType +} + +func GetCreateClusterReqV11CoreDataVolumeTypeEnum() CreateClusterReqV11CoreDataVolumeTypeEnum { + return CreateClusterReqV11CoreDataVolumeTypeEnum{ + SATA: CreateClusterReqV11CoreDataVolumeType{ + value: "SATA", + }, + SAS: CreateClusterReqV11CoreDataVolumeType{ + value: "SAS", + }, + SSD: CreateClusterReqV11CoreDataVolumeType{ + value: "SSD", + }, + GPSSD: CreateClusterReqV11CoreDataVolumeType{ + value: "GPSSD", + }, + } +} + +func (c CreateClusterReqV11CoreDataVolumeType) Value() string { + return c.value +} + +func (c CreateClusterReqV11CoreDataVolumeType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateClusterReqV11CoreDataVolumeType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type CreateClusterReqV11SafeMode struct { + value int32 +} + +type CreateClusterReqV11SafeModeEnum struct { + E_0 CreateClusterReqV11SafeMode + E_1 CreateClusterReqV11SafeMode +} + +func GetCreateClusterReqV11SafeModeEnum() CreateClusterReqV11SafeModeEnum { + return CreateClusterReqV11SafeModeEnum{ + E_0: CreateClusterReqV11SafeMode{ + value: 0, + }, E_1: CreateClusterReqV11SafeMode{ + value: 1, + }, + } +} + +func (c CreateClusterReqV11SafeMode) Value() int32 { + return c.value +} + +func (c CreateClusterReqV11SafeMode) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateClusterReqV11SafeMode) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("int32") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(int32) + return nil + } + return err + } else { + return errors.New("convert enum data to int32 error") + } +} + +type CreateClusterReqV11ClusterType struct { + value int32 +} + +type CreateClusterReqV11ClusterTypeEnum struct { + E_0 CreateClusterReqV11ClusterType + E_1 CreateClusterReqV11ClusterType +} + +func GetCreateClusterReqV11ClusterTypeEnum() CreateClusterReqV11ClusterTypeEnum { + return CreateClusterReqV11ClusterTypeEnum{ + E_0: CreateClusterReqV11ClusterType{ + value: 0, + }, E_1: CreateClusterReqV11ClusterType{ + value: 1, + }, + } +} + +func (c CreateClusterReqV11ClusterType) Value() int32 { + return c.value +} + +func (c CreateClusterReqV11ClusterType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateClusterReqV11ClusterType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("int32") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(int32) + return nil + } + return err + } else { + return errors.New("convert enum data to int32 error") + } +} + +type CreateClusterReqV11LogCollection struct { + value int32 +} + +type CreateClusterReqV11LogCollectionEnum struct { + E_0 CreateClusterReqV11LogCollection + E_1 CreateClusterReqV11LogCollection +} + +func GetCreateClusterReqV11LogCollectionEnum() CreateClusterReqV11LogCollectionEnum { + return CreateClusterReqV11LogCollectionEnum{ + E_0: CreateClusterReqV11LogCollection{ + value: 0, + }, E_1: CreateClusterReqV11LogCollection{ + value: 1, + }, + } +} + +func (c CreateClusterReqV11LogCollection) Value() int32 { + return c.value +} + +func (c CreateClusterReqV11LogCollection) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateClusterReqV11LogCollection) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("int32") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(int32) + return nil + } + return err + } else { + return errors.New("convert enum data to int32 error") + } +} + +type CreateClusterReqV11LoginMode struct { + value int32 +} + +type CreateClusterReqV11LoginModeEnum struct { + E_0 CreateClusterReqV11LoginMode + E_1 CreateClusterReqV11LoginMode +} + +func GetCreateClusterReqV11LoginModeEnum() CreateClusterReqV11LoginModeEnum { + return CreateClusterReqV11LoginModeEnum{ + E_0: CreateClusterReqV11LoginMode{ + value: 0, + }, E_1: CreateClusterReqV11LoginMode{ + value: 1, + }, + } +} + +func (c CreateClusterReqV11LoginMode) Value() int32 { + return c.value +} + +func (c CreateClusterReqV11LoginMode) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *CreateClusterReqV11LoginMode) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("int32") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(int32) + return nil + } + return err + } else { + return errors.New("convert enum data to int32 error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_request.go new file mode 100644 index 00000000..8486b0e0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_request.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type CreateClusterRequest struct { + Body *CreateClusterReqV11 `json:"body,omitempty"` +} + +func (o CreateClusterRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateClusterRequest struct{}" + } + + return strings.Join([]string{"CreateClusterRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_response.go new file mode 100644 index 00000000..020642f7 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_response.go @@ -0,0 +1,30 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type CreateClusterResponse struct { + + // 操作结果。 - true:操作成功 - false:操作失败 + Result *bool `json:"result,omitempty"` + + // 系统提示信息,可为空。 + Msg *string `json:"msg,omitempty"` + + // 集群创建成功后系统返回的集群ID值。 + ClusterId *string `json:"cluster_id,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o CreateClusterResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateClusterResponse struct{}" + } + + return strings.Join([]string{"CreateClusterResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_tag_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_tag_request.go new file mode 100644 index 00000000..3794c891 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_tag_request.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type CreateClusterTagRequest struct { + + // 集群ID。 + ClusterId string `json:"cluster_id"` + + Body *CreateTagReq `json:"body,omitempty"` +} + +func (o CreateClusterTagRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateClusterTagRequest struct{}" + } + + return strings.Join([]string{"CreateClusterTagRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_tag_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_tag_response.go new file mode 100644 index 00000000..41cbe235 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_cluster_tag_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type CreateClusterTagResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o CreateClusterTagResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateClusterTagResponse struct{}" + } + + return strings.Join([]string{"CreateClusterTagResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_scaling_policy_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_scaling_policy_request.go new file mode 100644 index 00000000..093949e4 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_scaling_policy_request.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type CreateScalingPolicyRequest struct { + + // 集群ID。获取方法,请参见[获取集群ID](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html)。 + ClusterId string `json:"cluster_id"` + + Body *AutoScalingPolicyReqV11 `json:"body,omitempty"` +} + +func (o CreateScalingPolicyRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateScalingPolicyRequest struct{}" + } + + return strings.Join([]string{"CreateScalingPolicyRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_scaling_policy_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_scaling_policy_response.go new file mode 100644 index 00000000..21326e0b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_scaling_policy_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type CreateScalingPolicyResponse struct { + Body *string `json:"body,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o CreateScalingPolicyResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateScalingPolicyResponse struct{}" + } + + return strings.Join([]string{"CreateScalingPolicyResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_tag_req.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_tag_req.go new file mode 100644 index 00000000..5b08ccf3 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_create_tag_req.go @@ -0,0 +1,20 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type CreateTagReq struct { + Tag *Tag `json:"tag"` +} + +func (o CreateTagReq) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "CreateTagReq struct{}" + } + + return strings.Join([]string{"CreateTagReq", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_request.go new file mode 100644 index 00000000..f20ba3cf --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_request.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeleteClusterRequest struct { + + // 集群ID。获取方法,请参见[获取集群ID](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html)。 + ClusterId string `json:"cluster_id"` +} + +func (o DeleteClusterRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteClusterRequest struct{}" + } + + return strings.Join([]string{"DeleteClusterRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_response.go new file mode 100644 index 00000000..3ffe04df --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeleteClusterResponse struct { + Body *string `json:"body,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o DeleteClusterResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteClusterResponse struct{}" + } + + return strings.Join([]string{"DeleteClusterResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_tag_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_tag_request.go new file mode 100644 index 00000000..b5d41a0b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_tag_request.go @@ -0,0 +1,26 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeleteClusterTagRequest struct { + + // 集群ID。 + ClusterId string `json:"cluster_id"` + + // 键。标签的key值 + Key string `json:"key"` +} + +func (o DeleteClusterTagRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteClusterTagRequest struct{}" + } + + return strings.Join([]string{"DeleteClusterTagRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_tag_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_tag_response.go new file mode 100644 index 00000000..b1feac5e --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_cluster_tag_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeleteClusterTagResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o DeleteClusterTagResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteClusterTagResponse struct{}" + } + + return strings.Join([]string{"DeleteClusterTagResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_job_execution_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_job_execution_request.go new file mode 100644 index 00000000..9ad417a3 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_job_execution_request.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type DeleteJobExecutionRequest struct { + + // 作业ID。 + JobExecutionId string `json:"job_execution_id"` +} + +func (o DeleteJobExecutionRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteJobExecutionRequest struct{}" + } + + return strings.Join([]string{"DeleteJobExecutionRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_job_execution_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_job_execution_response.go new file mode 100644 index 00000000..ccf89118 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_delete_job_execution_response.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type DeleteJobExecutionResponse struct { + HttpStatusCode int `json:"-"` +} + +func (o DeleteJobExecutionResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "DeleteJobExecutionResponse struct{}" + } + + return strings.Join([]string{"DeleteJobExecutionResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_host_model.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_host_model.go new file mode 100644 index 00000000..e21a9b5a --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_host_model.go @@ -0,0 +1,64 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type HostModel struct { + + // 虚拟机ID + Id *string `json:"id,omitempty"` + + // 虚拟机名称 + Name *string `json:"name,omitempty"` + + // 虚拟机IP地址 + Ip *string `json:"ip,omitempty"` + + // 可用区域 + AvailabilityZoneId *string `json:"availability_zone_id,omitempty"` + + // 标签列表信息 + Tags *[]TagPlain `json:"tags,omitempty"` + + // 虚拟机当前状态 + Status *string `json:"status,omitempty"` + + // 节点资源ID + ResourceId *string `json:"resource_id,omitempty"` + + // 虚拟机规格ID + Flavor *string `json:"flavor,omitempty"` + + // 虚拟机类型,当前支持MasterNode,CoreNode,TaskNode + Type *string `json:"type,omitempty"` + + // 内存 + Mem *string `json:"mem,omitempty"` + + // CPU核数 + Cpu *string `json:"cpu,omitempty"` + + // 操作系统盘容量 + RootVolumeSize *string `json:"root_volume_size,omitempty"` + + // 数据盘类型 + DataVolumeType *string `json:"data_volume_type,omitempty"` + + // 数据盘容量 + DataVolumeSize *int32 `json:"data_volume_size,omitempty"` + + // 数据盘个数 + DataVolumeCount *int32 `json:"data_volume_count,omitempty"` +} + +func (o HostModel) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "HostModel struct{}" + } + + return strings.Join([]string{"HostModel", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_job_exe_result.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_job_exe_result.go new file mode 100644 index 00000000..b4d6e0b8 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_job_exe_result.go @@ -0,0 +1,118 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type JobExeResult struct { + + // 作业ID。 + Id string `json:"id"` + + // 作业创建时间,十三位时间戳。 + CreateAt int64 `json:"create_at"` + + // 作业更新时间,十三位时间戳。 + UpdateAt int64 `json:"update_at"` + + // 项目编号。获取方法,请参见[获取项目ID](https://support.huaweicloud.com/api-mrs/mrs_02_0011.html)。 + TenantId string `json:"tenant_id"` + + // 作业ID。 + JobId string `json:"job_id"` + + // 作业名称。 + JobName string `json:"job_name"` + + // 作业执行开始时间,十三位时间戳。 + StartTime int64 `json:"start_time"` + + // 作业执行结束时间,十三位时间戳。 + EndTime int64 `json:"end_time"` + + // 作业所属集群ID。 + ClusterId string `json:"cluster_id"` + + // 作业执行组ID + GroupId string `json:"group_id"` + + // 执行程序jar包或sql文件地址。 + JarPath string `json:"jar_path"` + + // 数据输入地址。 + Input string `json:"input"` + + // 数据输出地址。 + Output *string `json:"output,omitempty"` + + // 作业日志存储地址 + JobLog string `json:"job_log"` + + // 作业类型码。 - 1:MapReduce - 2:Spark - 3:Hive Script - 4:HiveSQL(当前不支持) - 5:DistCp - 6:Spark Script - 7:Spark SQL(该接口当前不支持) + JobType int32 `json:"job_type"` + + // 导入导出数据。 + FileAction string `json:"file_action"` + + // 程序执行的关键参数,该参数由用户程序内的函数指定,MRS只负责参数的传入。该参数可为空。 + Arguments string `json:"arguments"` + + // HQL脚本语句。 + Hql string `json:"hql"` + + // 作业状态编码: - 1:Terminated表示已终止的作业状态 - 2:Running表示运行中的作业状态 - 3:Completed表示已完成的作业状态 - 4:Abnormal表示异常的作业状态 + JobState int32 `json:"job_state"` + + // 作业最终状态码。 - 0:未完成 - 1:执行错误,终止执行 - 2:执行完成并且成功 - 3:已取消 + JobFinalStatus int32 `json:"job_final_status"` + + // Hive脚本地址。 + HiveScriptPath string `json:"hive_script_path"` + + // 创建作业的用户ID。 + CreateBy string `json:"create_by"` + + // 当前已完成的步骤数。 + FinishedStep int32 `json:"finished_step"` + + // 作业主ID。 + JobMainId string `json:"job_main_id"` + + // 作业步骤ID。 + JobStepId string `json:"job_step_id"` + + // 延迟时间,十三位时间戳。 + PostponeAt int64 `json:"postpone_at"` + + // 作业步骤名。 + StepName string `json:"step_name"` + + // 步骤数量。 + StepNum int32 `json:"step_num"` + + // 任务数量。 + TaskNum int32 `json:"task_num"` + + // 更新作业的用户ID。 + UpdateBy string `json:"update_by"` + + // 作业执行持续时间,单位:秒。 + SpendTime float32 `json:"spend_time"` + + // 步骤序列号。 + StepSeq int32 `json:"step_seq"` + + // 作业执行进度。 + Progress string `json:"progress"` +} + +func (o JobExeResult) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "JobExeResult struct{}" + } + + return strings.Join([]string{"JobExeResult", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_all_tags_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_all_tags_request.go new file mode 100644 index 00000000..22b94213 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_all_tags_request.go @@ -0,0 +1,20 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListAllTagsRequest struct { +} + +func (o ListAllTagsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListAllTagsRequest struct{}" + } + + return strings.Join([]string{"ListAllTagsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_all_tags_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_all_tags_response.go new file mode 100644 index 00000000..2adb1f8c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_all_tags_response.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListAllTagsResponse struct { + + // 标签列表信息 + Tags *[]TagWithMultiValue `json:"tags,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListAllTagsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListAllTagsResponse struct{}" + } + + return strings.Join([]string{"ListAllTagsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_cluster_tags_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_cluster_tags_request.go new file mode 100644 index 00000000..a8fbb080 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_cluster_tags_request.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListClusterTagsRequest struct { + + // 集群ID。获取方法,请参见[获取集群ID](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html)。 + ClusterId string `json:"cluster_id"` +} + +func (o ListClusterTagsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListClusterTagsRequest struct{}" + } + + return strings.Join([]string{"ListClusterTagsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_cluster_tags_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_cluster_tags_response.go new file mode 100644 index 00000000..deb7249b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_cluster_tags_response.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListClusterTagsResponse struct { + + // 标签列表 + Tags *[]TagPlain `json:"tags,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListClusterTagsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListClusterTagsResponse struct{}" + } + + return strings.Join([]string{"ListClusterTagsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_by_tags_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_by_tags_request.go new file mode 100644 index 00000000..f91db779 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_by_tags_request.go @@ -0,0 +1,21 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListClustersByTagsRequest struct { + Body *ListResourceReq `json:"body,omitempty"` +} + +func (o ListClustersByTagsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListClustersByTagsRequest struct{}" + } + + return strings.Join([]string{"ListClustersByTagsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_by_tags_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_by_tags_response.go new file mode 100644 index 00000000..a09809b8 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_by_tags_response.go @@ -0,0 +1,27 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListClustersByTagsResponse struct { + + // 资源列表 + Resources *[]MrsResource `json:"resources,omitempty"` + + // 资源总数 + TotalCount *int32 `json:"total_count,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListClustersByTagsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListClustersByTagsResponse struct{}" + } + + return strings.Join([]string{"ListClustersByTagsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_request.go new file mode 100644 index 00000000..58f3c721 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_request.go @@ -0,0 +1,38 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListClustersRequest struct { + + // 可以通过集群的标签来搜索指定标签的集群,当指定多个tag进行查询时,标签之间是与的关系。 - tags参数的格式为tags=k1*v1,k2*v2,k3*v3 - 当标签的value为空时,格式为tags=k1,k2,k3*v3 + Tags *string `json:"tags,omitempty"` + + // 分页查询每页返回的最大集群数量。 取值范围:[1~2147483646] + PageSize *string `json:"pageSize,omitempty"` + + // 当前查询页码。 + CurrentPage *string `json:"currentPage,omitempty"` + + // 集群名称。 + ClusterName *string `json:"clusterName,omitempty"` + + // 根据集群状态查询集群列表。 - existing:查询现有集群列表,包括除“已删除”、包周期集群的“订单处理中”和“准备中”状态外的所有集群。 - history:查询历史集群列表,包括所有“已删除”、删除集群失败、集群删除虚拟机失败、删除集群更新数据库失败等状态的集群。 - starting:查询启动中的集群列表。 - running:查询运行中的集群列表。 - terminated:查询已删除的集群列表。 - failed:查询失败的集群列表。 - abnormal:查询异常的集群列表。 - terminating:查询删除中的集群列表。 - frozen:查询已冻结的集群列表。 - scaling-out:查询扩容中的集群列表。 - scaling-in:查询缩容中的集群列表。 + ClusterState *string `json:"clusterState,omitempty"` + + // 通过企业项目ID来搜索指定项目的集群。 该参数默认设置为0,表示为default企业项目。 获取方式请参见《企业管理API参考》的“查询企业项目列表”响应消息表“enterprise_project字段数据结构说明”的“id”。 + EnterpriseProjectId *string `json:"enterpriseProjectId,omitempty"` +} + +func (o ListClustersRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListClustersRequest struct{}" + } + + return strings.Join([]string{"ListClustersRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_response.go new file mode 100644 index 00000000..79d41f17 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_clusters_response.go @@ -0,0 +1,27 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListClustersResponse struct { + + // 集群列表总数。 + ClusterTotal *int32 `json:"clusterTotal,omitempty"` + + // 集群参数。 + Clusters *[]Cluster `json:"clusters,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListClustersResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListClustersResponse struct{}" + } + + return strings.Join([]string{"ListClustersResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_execute_job_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_execute_job_request.go new file mode 100644 index 00000000..245f4af4 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_execute_job_request.go @@ -0,0 +1,38 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListExecuteJobRequest struct { + + // 分页查询每页返回的最大作业数量。 取值范围:[1~100] + PageSize *string `json:"page_size,omitempty"` + + // 当前查询页码。 + CurrentPage *string `json:"current_page,omitempty"` + + // 作业名称。 + JobName *string `json:"job_name,omitempty"` + + // 集群编号。 + ClusterId string `json:"cluster_id"` + + // 作业状态编码: - 1:Terminated表示已终止的作业状态 - 2:Running表示运行中的作业状态 - 3:Completed表示已完成的作业状态 - 4:Abnormal表示异常的作业状态 + State *string `json:"state,omitempty"` + + // 作业执行对象的编号。 + Id *string `json:"id,omitempty"` +} + +func (o ListExecuteJobRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListExecuteJobRequest struct{}" + } + + return strings.Join([]string{"ListExecuteJobRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_execute_job_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_execute_job_response.go new file mode 100644 index 00000000..52aec932 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_execute_job_response.go @@ -0,0 +1,27 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListExecuteJobResponse struct { + + // 作业列表总数。 + TotalRecord *int32 `json:"totalRecord,omitempty"` + + // 作业列表。 + JobExecutions *[]JobExeResult `json:"job_executions,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListExecuteJobResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListExecuteJobResponse struct{}" + } + + return strings.Join([]string{"ListExecuteJobResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_hosts_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_hosts_request.go new file mode 100644 index 00000000..c245ed22 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_hosts_request.go @@ -0,0 +1,29 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ListHostsRequest struct { + + // 集群ID。获取方法,请参见[获取集群ID](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html)。 + ClusterId string `json:"cluster_id"` + + // 分页查询每页返回的最大集群数量。 取值范围:[1~2147483646] 默认值为10。 + PageSize *string `json:"pageSize,omitempty"` + + // 当前查询页码。默认值为1。 + CurrentPage *string `json:"currentPage,omitempty"` +} + +func (o ListHostsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListHostsRequest struct{}" + } + + return strings.Join([]string{"ListHostsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_hosts_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_hosts_response.go new file mode 100644 index 00000000..90b75f6f --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_hosts_response.go @@ -0,0 +1,27 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ListHostsResponse struct { + + // 主机参数。 + Hosts *[]HostModel `json:"hosts,omitempty"` + + // 主机列表总数。 + Total *int32 `json:"total,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ListHostsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListHostsResponse struct{}" + } + + return strings.Join([]string{"ListHostsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_resource_req.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_resource_req.go new file mode 100644 index 00000000..fdc4ffec --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_list_resource_req.go @@ -0,0 +1,88 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type ListResourceReq struct { + + // 返回结果包含该参数中所有标签对应的资源,该参数最多包含10个key,每个key下面的value最多10个,结构体不能缺失,key不能为空或者空字符串。 + Tags *[]TagWithMultiValue `json:"tags,omitempty"` + + // 返回结果包含该参数中任意一个标签对应的资源,该参数最多包含10个key,每个key下面的value最多10个,结构体不能缺失,key不能为空或者空字符串。Key不能重复,同一个key中values不能重复。 + TagsAny *[]TagWithMultiValue `json:"tags_any,omitempty"` + + // 返回结果不包含该参数中所有标签对应的资源,该参数最多包含10个key,每个key下面的value最多10个, 结构体不能缺失,key不能为空或者空字符串。Key不能重复,同一个key中values不能重复。 + NotTags *[]TagWithMultiValue `json:"not_tags,omitempty"` + + // 返回结果不包含该参数中任意一个标签对应的资源,该参数最多包含10个key,每个key下面的value最多10个,结构体不能缺失,key不能为空或者空字符串。Key不能重复,同一个key中values不能重复。 + NotTagsAny *[]TagWithMultiValue `json:"not_tags_any,omitempty"` + + // 操作标识(仅限于filter,count):filter(过滤),count(查询总条数)。 如果是filter则为分页查询,如果是count会按照条件将总条数返回。 + Action ListResourceReqAction `json:"action"` + + // 查询记录数(action为count时无此参数)如果action为filter默认为1000,limit最多为1000,不能为负数,最小值为1。 + Limit *int32 `json:"limit,omitempty"` + + // (索引位置),从offset指定的下一条数据开始查询。查询第一页数据时,不需要传入此参数,查询后续页码数据时,将查询前一页数据时响应体中的值带入此参数(action为count时无此参数)如果action为filter默认为0,必须为数字,不能为负数。 + Offset *int32 `json:"offset,omitempty"` + + // 搜索字段,key为要匹配的字段,如resource_name等。value为匹配的值。此字段为固定字典值。 根据不同的字段确认是否需要模糊匹配,如resource_name默认为模糊搜索,如果value为空字符串精确匹配。 + Matches *[]Match `json:"matches,omitempty"` +} + +func (o ListResourceReq) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ListResourceReq struct{}" + } + + return strings.Join([]string{"ListResourceReq", string(data)}, " ") +} + +type ListResourceReqAction struct { + value string +} + +type ListResourceReqActionEnum struct { + FILTER ListResourceReqAction + COUNT ListResourceReqAction +} + +func GetListResourceReqActionEnum() ListResourceReqActionEnum { + return ListResourceReqActionEnum{ + FILTER: ListResourceReqAction{ + value: "filter", + }, + COUNT: ListResourceReqAction{ + value: "count", + }, + } +} + +func (c ListResourceReqAction) Value() string { + return c.value +} + +func (c ListResourceReqAction) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ListResourceReqAction) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_match.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_match.go new file mode 100644 index 00000000..919dcaaf --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_match.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type Match struct { + + // 键。当前只有resource_name可用,表示集群的名称,后续扩展。 + Key *string `json:"key,omitempty"` + + // 值。每个值最大长度64个unicode字符。 + Value *string `json:"value,omitempty"` +} + +func (o Match) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Match struct{}" + } + + return strings.Join([]string{"Match", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_mrs_resource.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_mrs_resource.go new file mode 100644 index 00000000..9f1dfed0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_mrs_resource.go @@ -0,0 +1,31 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type MrsResource struct { + + // 资源ID + ResourceId *string `json:"resource_id,omitempty"` + + // 资源详情 + ResourceDetail *string `json:"resource_detail,omitempty"` + + // 标签 + Tags *[]TagPlain `json:"tags,omitempty"` + + // 资源名称 + ResourceName *string `json:"resource_name,omitempty"` +} + +func (o MrsResource) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "MrsResource struct{}" + } + + return strings.Join([]string{"MrsResource", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_node_group_v10.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_node_group_v10.go new file mode 100644 index 00000000..61d8418b --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_node_group_v10.go @@ -0,0 +1,126 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type NodeGroupV10 struct { + + // 节点组名。 + GroupName *string `json:"GroupName,omitempty"` + + // 节点数量,取值范围0~500,Master节点和Core节点数量至少为1,Core与Task节点总数最大为500个。 + NodeNum *int32 `json:"NodeNum,omitempty"` + + // 节点的实例规格。 + NodeSize *string `json:"NodeSize,omitempty"` + + // 节点实例规格ID。 + NodeSpecId *string `json:"NodeSpecId,omitempty"` + + // 节点虚拟机产品ID。 + VmProductId *string `json:"VmProductId,omitempty"` + + // 节点虚拟机产品规格。 + VmSpecCode *string `json:"VmSpecCode,omitempty"` + + // 节点实例产品ID。 + NodeProductId *string `json:"NodeProductId,omitempty"` + + // 节点系统盘大小,不可配置,默认为40GB。 + RootVolumeSize *int32 `json:"RootVolumeSize,omitempty"` + + // 节点系统盘的产品ID。 + RootVolumeProductId *string `json:"RootVolumeProductId,omitempty"` + + // 节点系统盘的类型。 + RootVolumeType *string `json:"RootVolumeType,omitempty"` + + // 节点系统盘产品规格。 + RootVolumeResourceSpecCode *string `json:"RootVolumeResourceSpecCode,omitempty"` + + // 节点系统盘产品类型。 + RootVolumeResourceType *string `json:"RootVolumeResourceType,omitempty"` + + // 节点数据磁盘存储类别,目前支持SATA、SAS和SSD。 - SATA:普通IO - SAS:高IO - SSD:超高IO + DataVolumeType *NodeGroupV10DataVolumeType `json:"DataVolumeType,omitempty"` + + // 节点数据磁盘存储数目。 + DataVolumeCount *int32 `json:"DataVolumeCount,omitempty"` + + // 节点数据磁盘存储大小。 + DataVolumeSize *int32 `json:"DataVolumeSize,omitempty"` + + // 节点数据磁盘的产品ID。 + DataVolumeProductId *string `json:"DataVolumeProductId,omitempty"` + + // 节点数据磁盘的产品规格。 + DataVolumeResourceSpecCode *string `json:"DataVolumeResourceSpecCode,omitempty"` + + // 节点数据磁盘的产品类型。 + DataVolumeResourceType *string `json:"DataVolumeResourceType,omitempty"` +} + +func (o NodeGroupV10) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "NodeGroupV10 struct{}" + } + + return strings.Join([]string{"NodeGroupV10", string(data)}, " ") +} + +type NodeGroupV10DataVolumeType struct { + value string +} + +type NodeGroupV10DataVolumeTypeEnum struct { + SATA NodeGroupV10DataVolumeType + SAS NodeGroupV10DataVolumeType + SSD NodeGroupV10DataVolumeType + GPSSD NodeGroupV10DataVolumeType +} + +func GetNodeGroupV10DataVolumeTypeEnum() NodeGroupV10DataVolumeTypeEnum { + return NodeGroupV10DataVolumeTypeEnum{ + SATA: NodeGroupV10DataVolumeType{ + value: "SATA", + }, + SAS: NodeGroupV10DataVolumeType{ + value: "SAS", + }, + SSD: NodeGroupV10DataVolumeType{ + value: "SSD", + }, + GPSSD: NodeGroupV10DataVolumeType{ + value: "GPSSD", + }, + } +} + +func (c NodeGroupV10DataVolumeType) Value() string { + return c.value +} + +func (c NodeGroupV10DataVolumeType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *NodeGroupV10DataVolumeType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_node_group_v11.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_node_group_v11.go new file mode 100644 index 00000000..27b9519c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_node_group_v11.go @@ -0,0 +1,45 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type NodeGroupV11 struct { + + // 节点组名。 - master_node_default_group - core_node_analysis_group - core_node_streaming_group - task_node_analysis_group - task_node_streaming_group + GroupName string `json:"group_name"` + + // 节点数量,取值范围0~500,Core与Task节点总数最大为500个。 + NodeNum int32 `json:"node_num"` + + // 节点的实例规格,例如:c3.4xlarge.2.linux.bigdata。MRS当前支持主机规格的配型由CPU+内存+Disk共同决定。实例规格详细说明请参见[MRS所使用的弹性云服务器规格](https://support.huaweicloud.com/api-mrs/mrs_01_9006.html)和[MRS所使用的裸金属服务器规格](https://support.huaweicloud.com/api-mrs/mrs_01_9001.html)。 该参数建议从MRS控制台的集群创建页面获取对应区域对应版本所支持的规格。 + NodeSize string `json:"node_size"` + + // 节点系统磁盘存储大小。 + RootVolumeSize *string `json:"root_volume_size,omitempty"` + + // 节点系统磁盘存储类别,目前支持SATA、SAS和SSD。 - SATA:普通IO - SAS:高IO - SSD:超高IO - GPSSD:通用型SSD + RootVolumeType *string `json:"root_volume_type,omitempty"` + + // 节点数据磁盘存储类别,目前支持SATA、SAS和SSD。 - SATA:普通IO - SAS:高IO - SSD:超高IO - GPSSD:通用型SSD + DataVolumeType *string `json:"data_volume_type,omitempty"` + + // 节点数据磁盘存储数目 取值范围:0~10。 + DataVolumeCount *int32 `json:"data_volume_count,omitempty"` + + // 节点数据磁盘存储大小 取值范围:100GB~32000GB。 + DataVolumeSize *int32 `json:"data_volume_size,omitempty"` + + AutoScalingPolicy *AutoScalingPolicy `json:"auto_scaling_policy,omitempty"` +} + +func (o NodeGroupV11) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "NodeGroupV11 struct{}" + } + + return strings.Join([]string{"NodeGroupV11", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_resources_plan.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_resources_plan.go new file mode 100644 index 00000000..38829ea2 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_resources_plan.go @@ -0,0 +1,34 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type ResourcesPlan struct { + + // 资源计划的周期类型,当前只允许以下类型: daily + PeriodType string `json:"period_type"` + + // 资源计划的起始时间,格式为“hour:minute”,表示时间在0:00-23:59之间。 + StartTime string `json:"start_time"` + + // 资源计划的结束时间,格式与“start_time”相同,不早于start_time表示的时间,且与start_time间隔不小于30min。 + EndTime string `json:"end_time"` + + // 资源计划内该节点组的最小保留节点数。 取值范围:[0~500] + MinCapacity int32 `json:"min_capacity"` + + // 资源计划内该节点组的最大保留节点数。 取值范围:[0~500] + MaxCapacity int32 `json:"max_capacity"` +} + +func (o ResourcesPlan) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ResourcesPlan struct{}" + } + + return strings.Join([]string{"ResourcesPlan", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_rule.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_rule.go new file mode 100644 index 00000000..8acfd487 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_rule.go @@ -0,0 +1,81 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type Rule struct { + + // 弹性伸缩规则的名称。 只能由字母、数字、中划线和下划线组成,并且长度为1~64个字符。 在一个节点组范围内,不允许重名。 + Name string `json:"name"` + + // 弹性伸缩规则的说明。 最大长度为1024字符。 + Description *string `json:"description,omitempty"` + + // 弹性伸缩规则的调整类型,只允许以下类型: 枚举值: - scale_out:扩容 - scale_in:缩容 + AdjustmentType RuleAdjustmentType `json:"adjustment_type"` + + // 触发弹性伸缩规则后,该集群处于冷却状态(不再执行弹性伸缩操作)的时长,单位为分钟。 取值范围[0~10080],10080为一周的分钟数。 + CoolDownMinutes int32 `json:"cool_down_minutes"` + + // 单次调整集群节点的个数。 取值范围[1~100] + ScalingAdjustment int32 `json:"scaling_adjustment"` + + Trigger *Trigger `json:"trigger"` +} + +func (o Rule) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Rule struct{}" + } + + return strings.Join([]string{"Rule", string(data)}, " ") +} + +type RuleAdjustmentType struct { + value string +} + +type RuleAdjustmentTypeEnum struct { + SCALE_OUT RuleAdjustmentType + SCALE_IN RuleAdjustmentType +} + +func GetRuleAdjustmentTypeEnum() RuleAdjustmentTypeEnum { + return RuleAdjustmentTypeEnum{ + SCALE_OUT: RuleAdjustmentType{ + value: "scale_out", + }, + SCALE_IN: RuleAdjustmentType{ + value: "scale_in", + }, + } +} + +func (c RuleAdjustmentType) Value() string { + return c.value +} + +func (c RuleAdjustmentType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *RuleAdjustmentType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_scale_script.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_scale_script.go new file mode 100644 index 00000000..d651111e --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_scale_script.go @@ -0,0 +1,135 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type ScaleScript struct { + + // 弹性伸缩自定义自动化脚本的名称,同一个集群的自定义自动化脚本名称不允许相同。 只能由数字、英文字符、空格、中划线和下划线组成,且不能以空格开头。 可输入的字符串长度为1~64个字符。 + Name string `json:"name"` + + // 自定义自动化脚本的路径。设置为OBS桶的路径或虚拟机本地的路径。 - OBS桶的路径:直接手动输入脚本路径。示例:s3a://XXX/scale.sh - 虚拟机本地的路径:用户需要输入正确的脚本路径。脚本所在的路径必须以‘/’开头,以.sh结尾。 + Uri string `json:"uri"` + + // 自定义自动化脚本参数。 多个参数间用空格隔开。 可以传入以下系统预定义参数: - ${mrs_scale_node_num}:扩缩容节点数 - ${mrs_scale_type}:扩缩容类型,扩容为scale_out,缩容为scale_in - ${mrs_scale_node_hostnames}:扩缩容的节点主机名称 - ${mrs_scale_node_ips}:扩缩容的节点IP - ${mrs_scale_rule_name}:触发扩缩容的规则名 其他用户自定义参数使用方式与普通shell脚本相同,多个参数中间用空格隔开。 + Parameters *string `json:"parameters,omitempty"` + + // 自定义自动化脚本所执行的节点组名称(非自定义集群也可使用节点类型,包含Master、Core和Task三种类型)。 + Nodes []string `json:"nodes"` + + // 自定义自动化脚本是否只运行在主Master节点上。 缺省值为false,表示自定义自动化脚本可运行在所有Master节点上。 + ActiveMaster *bool `json:"active_master,omitempty"` + + // 自自定义自动化脚本执行失败后,是否继续执行后续脚本和创建集群。 说明: - 建议您在调试阶段设置为“continue”,无论此自定义自动化脚本是否执行成功,则集群都能继续安装和启动。 - 由于缩容成功无法回滚,因此缩容后执行的脚本“fail_action”必须设置为“continue”。 枚举值: - continue:继续执行后续脚本。 - errorout:终止操作。 + FailAction ScaleScriptFailAction `json:"fail_action"` + + // 脚本执行时机。 枚举值: - before_scale_out:扩容前 - before_scale_in:缩容前 - after_scale_out:扩容后 - after_scale_in:缩容后 + ActionStage ScaleScriptActionStage `json:"action_stage"` +} + +func (o ScaleScript) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ScaleScript struct{}" + } + + return strings.Join([]string{"ScaleScript", string(data)}, " ") +} + +type ScaleScriptFailAction struct { + value string +} + +type ScaleScriptFailActionEnum struct { + CONTINUE ScaleScriptFailAction + ERROROUT ScaleScriptFailAction +} + +func GetScaleScriptFailActionEnum() ScaleScriptFailActionEnum { + return ScaleScriptFailActionEnum{ + CONTINUE: ScaleScriptFailAction{ + value: "continue", + }, + ERROROUT: ScaleScriptFailAction{ + value: "errorout", + }, + } +} + +func (c ScaleScriptFailAction) Value() string { + return c.value +} + +func (c ScaleScriptFailAction) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ScaleScriptFailAction) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} + +type ScaleScriptActionStage struct { + value string +} + +type ScaleScriptActionStageEnum struct { + BEFORE_SCALE_OUT ScaleScriptActionStage + BEFORE_SCALE_IN ScaleScriptActionStage + AFTER_SCALE_OUT ScaleScriptActionStage + AFTER_SCALE_IN ScaleScriptActionStage +} + +func GetScaleScriptActionStageEnum() ScaleScriptActionStageEnum { + return ScaleScriptActionStageEnum{ + BEFORE_SCALE_OUT: ScaleScriptActionStage{ + value: "before_scale_out", + }, + BEFORE_SCALE_IN: ScaleScriptActionStage{ + value: "before_scale_in", + }, + AFTER_SCALE_OUT: ScaleScriptActionStage{ + value: "after_scale_out", + }, + AFTER_SCALE_IN: ScaleScriptActionStage{ + value: "after_scale_in", + }, + } +} + +func (c ScaleScriptActionStage) Value() string { + return c.value +} + +func (c ScaleScriptActionStage) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *ScaleScriptActionStage) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_cluster_details_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_cluster_details_request.go new file mode 100644 index 00000000..a6437c41 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_cluster_details_request.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ShowClusterDetailsRequest struct { + + // 集群ID。获取方法,请参见[获取集群ID](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html)。 + ClusterId string `json:"cluster_id"` +} + +func (o ShowClusterDetailsRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowClusterDetailsRequest struct{}" + } + + return strings.Join([]string{"ShowClusterDetailsRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_cluster_details_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_cluster_details_response.go new file mode 100644 index 00000000..13d4a073 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_cluster_details_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ShowClusterDetailsResponse struct { + Cluster *Cluster `json:"cluster,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ShowClusterDetailsResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowClusterDetailsResponse struct{}" + } + + return strings.Join([]string{"ShowClusterDetailsResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_job_exes_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_job_exes_request.go new file mode 100644 index 00000000..f05b08e5 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_job_exes_request.go @@ -0,0 +1,23 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type ShowJobExesRequest struct { + + // 作业ID。 + JobExeId string `json:"job_exe_id"` +} + +func (o ShowJobExesRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowJobExesRequest struct{}" + } + + return strings.Join([]string{"ShowJobExesRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_job_exes_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_job_exes_response.go new file mode 100644 index 00000000..5482d421 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_show_job_exes_response.go @@ -0,0 +1,22 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type ShowJobExesResponse struct { + JobExecution *JobExeResult `json:"job_execution,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o ShowJobExesResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "ShowJobExesResponse struct{}" + } + + return strings.Join([]string{"ShowJobExesResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_submit_job_req_v11.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_submit_job_req_v11.go new file mode 100644 index 00000000..0a4f0d97 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_submit_job_req_v11.go @@ -0,0 +1,52 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type SubmitJobReqV11 struct { + + // 作业名称,只能由字母、数字、中划线和下划线组成,并且长度为1~64个字符。 说明: 不同作业的名称允许相同,但不建议设置相同。 + JobName string `json:"job_name"` + + // 集群ID。 + ClusterId string `json:"cluster_id"` + + // 执行程序Jar包或sql文件地址,需要满足如下要求: - 最多为1023字符,不能包含;|&><'$特殊字符,且不可为空或全空格。 - 需要以“/”或“s3a://”开头。OBS路径不支持KMS加密的文件或程序。 - Spark Script需要以“.sql”结尾,MapReduce和Spark Jar需要以“.jar”结尾,sql和jar不区分大小写。 说明: 作业类型为MapReduce或Spark时,jar_path参数为必选。 + JarPath *string `json:"jar_path,omitempty"` + + // 数据输入地址,必须以“/”或“s3a://”开头。请配置为正确的OBS路径,OBS路径不支持KMS加密的文件或程序。 最多为1023字符,不能包含;|&>'<$特殊字符,可为空。 + Input *string `json:"input,omitempty"` + + // 数据输出地址,必须以“/”或“s3a://”开头。请配置为正确的OBS路径,如果该路径不存在,系统会自动创建。 最多为1023字符,不能包含;|&>'<$特殊字符,可为空。 + Output *string `json:"output,omitempty"` + + // 作业日志存储地址,该日志信息记录作业运行状态。必须以“/”或“s3a://”开头,请配置为正确的OBS路径。 最多为1023字符,不能包含;|&>'<$特殊字符,可为空。 + JobLog *string `json:"job_log,omitempty"` + + // 作业类型码。 - 1:MapReduce - 2:Spark - 3:Hive Script - 4:HiveSQL(当前不支持) - 5:DistCp,导入、导出数据。 - 6:Spark Script - 7:Spark SQL,提交SQL语句(该接口当前不支持) + JobType int32 `json:"job_type"` + + // 文件操作类型,包括: - export:从HDFS导出数据至OBS - import:从OBS导入数据至HDFS + FileAction *string `json:"file_action,omitempty"` + + // 程序执行的关键参数,该参数由用户程序内的函数指定,MRS只负责参数的传入。 最多为150000字符,不能包含;|&>'<$!\\\"\\特殊字符,可为空。 说明: 用户输入带有敏感信息(如登录密码)的参数时,可通过在参数名前添加“@”的方式,为该参数值加密,以防止敏感信息被明文形式持久化。在查看作业信息时,敏感信息显示为“*”。 例如:username=admin @password=admin_123 + Arguments *string `json:"arguments,omitempty"` + + // Spark SQL语句,该语句需要进行Base64编码和解码,“ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/”为标准的编码表,MRS使用“ABCDEFGHILKJMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/”进行Base64编码。在编码后所得字符串首位任意加上一个字母,即得到Hql参数的值。后台自动进行解码得到Spark SQL语句。 使用样例: 1) 在Web界面输入Spark SQL语句“show tables;”。 2) 使用“ABCDEFGHILKJMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/”编码后得到字符串“c2hvdyB0YWLsZXM7”。 3) 在“c2hvdyB0YWLsZXM7”首位任意加上一字母,例如“gc2hvdyB0YWLsZXM7”,即Hql参数的值。 4) 后台自动进行解码得到Spark SQL语句“show tables;”。 + Hql *string `json:"hql,omitempty"` + + // sql程序路径,仅Spark Script和Hive Script作业需要使用此参数。需要满足如下要求: - 最多为1023字符,不能包含;|&><'$特殊字符,且不可为空或全空格。 - 需要以“/”或“s3a://”开头,OBS路径不支持KMS加密的文件或程序。 - 需要以“.sql”结尾,sql不区分大小写。 + HiveScriptPath *string `json:"hive_script_path,omitempty"` +} + +func (o SubmitJobReqV11) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "SubmitJobReqV11 struct{}" + } + + return strings.Join([]string{"SubmitJobReqV11", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_tag.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_tag.go new file mode 100644 index 00000000..d0457bf5 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_tag.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type Tag struct { + + // 键。 - 最大长度36个unicode字符,不能为空字符串。 - 标签的key值不能包含非打印字符ASCII(0-31),“=”,“*”,“<”,“>”,“\\”,“,”,“|”,“/”,且首尾字符不能为空格。 - 同一资源的key值不能重复。 + Key string `json:"key"` + + // 值。 - 最大长度43个unicode字符,可以为空字符串。 - 标签的value值不能包含非打印字符ASCII(0-31),“=”,“*”,“<”,“>”,“\\”,“,”,“|”,“/”,且首尾字符不能为空格。 + Value string `json:"value"` +} + +func (o Tag) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Tag struct{}" + } + + return strings.Join([]string{"Tag", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_tag_plain.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_tag_plain.go new file mode 100644 index 00000000..1d67f397 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_tag_plain.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type TagPlain struct { + + // 键。标签的key值不能包含“=”,“*”,“<”,“>”,“\\”,“,”,“|”,“/”,且首尾字符不能为空格。 + Key *string `json:"key,omitempty"` + + // 值。标签的value值不能包含“=”,“*”,“<”,“>”,“\\”,“,”,“|”,“/”,且首尾字符不能为空格。 + Value *string `json:"value,omitempty"` +} + +func (o TagPlain) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TagPlain struct{}" + } + + return strings.Join([]string{"TagPlain", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_tag_with_multi_value.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_tag_with_multi_value.go new file mode 100644 index 00000000..69c76329 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_tag_with_multi_value.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type TagWithMultiValue struct { + + // 键。标签的key值不能包含“=”,“*”,“<”,“>”,“\\”,“,”,“|”,“/”,且首尾字符不能为空格。 + Key string `json:"key"` + + // 值。标签的value值不能包含“=”,“*”,“<”,“>”,“\\”,“,”,“|”,“/”,且首尾字符不能为空格。 + Values *[]string `json:"values,omitempty"` +} + +func (o TagWithMultiValue) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TagWithMultiValue struct{}" + } + + return strings.Join([]string{"TagWithMultiValue", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_task_node_group.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_task_node_group.go new file mode 100644 index 00000000..f281d015 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_task_node_group.go @@ -0,0 +1,89 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type TaskNodeGroup struct { + + // Task节点节点数量,取值范围0~500,Core与Task节点总数最大为500个。 + NodeNum int32 `json:"node_num"` + + // Task节点的实例规格,例如:c3.4xlarge.2.linux.bigdata。实例规格详细说明请参见[MRS所使用的弹性云服务器规格](https://support.huaweicloud.com/api-mrs/mrs_01_9006.html)和[MRS所使用的裸金属服务器规格](https://support.huaweicloud.com/api-mrs/mrs_01_9001.html)。 该参数建议从MRS控制台的集群创建页面获取对应区域对应版本所支持的规格。 + NodeSize string `json:"node_size"` + + // Task节点数据磁盘存储类别,目前支持SATA、SAS和SSD。 - SATA:普通IO - SAS:高IO - SSD:超高IO - GPSSD:通用型SSD + DataVolumeType TaskNodeGroupDataVolumeType `json:"data_volume_type"` + + // Task节点数据磁盘存储数目,取值范围:0~10。 + DataVolumeCount int32 `json:"data_volume_count"` + + // Task节点数据磁盘存储大小。 取值范围:100GB~32000GB,传值只需填数字,不需要带单位GB。 + DataVolumeSize int32 `json:"data_volume_size"` + + AutoScalingPolicy *AutoScalingPolicy `json:"auto_scaling_policy,omitempty"` +} + +func (o TaskNodeGroup) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TaskNodeGroup struct{}" + } + + return strings.Join([]string{"TaskNodeGroup", string(data)}, " ") +} + +type TaskNodeGroupDataVolumeType struct { + value string +} + +type TaskNodeGroupDataVolumeTypeEnum struct { + SATA TaskNodeGroupDataVolumeType + SAS TaskNodeGroupDataVolumeType + SSD TaskNodeGroupDataVolumeType + GPSSD TaskNodeGroupDataVolumeType +} + +func GetTaskNodeGroupDataVolumeTypeEnum() TaskNodeGroupDataVolumeTypeEnum { + return TaskNodeGroupDataVolumeTypeEnum{ + SATA: TaskNodeGroupDataVolumeType{ + value: "SATA", + }, + SAS: TaskNodeGroupDataVolumeType{ + value: "SAS", + }, + SSD: TaskNodeGroupDataVolumeType{ + value: "SSD", + }, + GPSSD: TaskNodeGroupDataVolumeType{ + value: "GPSSD", + }, + } +} + +func (c TaskNodeGroupDataVolumeType) Value() string { + return c.value +} + +func (c TaskNodeGroupDataVolumeType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *TaskNodeGroupDataVolumeType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_task_node_info.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_task_node_info.go new file mode 100644 index 00000000..7426aaf0 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_task_node_info.go @@ -0,0 +1,84 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "errors" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/converter" + + "strings" +) + +type TaskNodeInfo struct { + + // Task节点的实例规格,例如:c3.4xlarge.2.linux.bigdata。实例规格详细说明请参见[MRS所使用的弹性云服务器规格](https://support.huaweicloud.com/api-mrs/mrs_01_9006.html)和[MRS所使用的裸金属服务器规格](https://support.huaweicloud.com/api-mrs/mrs_01_9001.html)。 该参数建议从MRS控制台的集群创建页面获取对应区域对应版本所支持的规格。 + NodeSize string `json:"node_size"` + + // Task节点数据磁盘存储类别,目前支持SATA、SAS和SSD。 - SATA:普通IO - SAS:高IO - SSD:超高IO - GPSSD:通用型SSD + DataVolumeType TaskNodeInfoDataVolumeType `json:"data_volume_type"` + + // Task节点数据磁盘存储数目,取值范围:0~10。 + DataVolumeCount int32 `json:"data_volume_count"` + + // Task节点数据磁盘存储大小。 取值范围:100GB~32000GB,传值只需填数字,不需要带单位GB。 + DataVolumeSize int32 `json:"data_volume_size"` +} + +func (o TaskNodeInfo) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "TaskNodeInfo struct{}" + } + + return strings.Join([]string{"TaskNodeInfo", string(data)}, " ") +} + +type TaskNodeInfoDataVolumeType struct { + value string +} + +type TaskNodeInfoDataVolumeTypeEnum struct { + SATA TaskNodeInfoDataVolumeType + SAS TaskNodeInfoDataVolumeType + SSD TaskNodeInfoDataVolumeType + GPSSD TaskNodeInfoDataVolumeType +} + +func GetTaskNodeInfoDataVolumeTypeEnum() TaskNodeInfoDataVolumeTypeEnum { + return TaskNodeInfoDataVolumeTypeEnum{ + SATA: TaskNodeInfoDataVolumeType{ + value: "SATA", + }, + SAS: TaskNodeInfoDataVolumeType{ + value: "SAS", + }, + SSD: TaskNodeInfoDataVolumeType{ + value: "SSD", + }, + GPSSD: TaskNodeInfoDataVolumeType{ + value: "GPSSD", + }, + } +} + +func (c TaskNodeInfoDataVolumeType) Value() string { + return c.value +} + +func (c TaskNodeInfoDataVolumeType) MarshalJSON() ([]byte, error) { + return utils.Marshal(c.value) +} + +func (c *TaskNodeInfoDataVolumeType) UnmarshalJSON(b []byte) error { + myConverter := converter.StringConverterFactory("string") + if myConverter != nil { + val, err := myConverter.CovertStringToInterface(strings.Trim(string(b[:]), "\"")) + if err == nil { + c.value = val.(string) + return nil + } + return err + } else { + return errors.New("convert enum data to string error") + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_trigger.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_trigger.go new file mode 100644 index 00000000..527d5ccb --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_trigger.go @@ -0,0 +1,31 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +type Trigger struct { + + // 指标名称。 该触发条件会依据该名称对应指标的值来进行判断。 最大长度为64个字符。 + MetricName string `json:"metric_name"` + + // 指标阈值。 触发该条件的指标阈值,只允许输入整数或者带两位小数的数。 + MetricValue string `json:"metric_value"` + + // 指标判断逻辑运算符,包括: - LT:小于 - GT:大于 - LTOE:小于等于 - GTOE:大于等于 + ComparisonOperator *string `json:"comparison_operator,omitempty"` + + // 判断连续满足指标阈值的周期数(一个周期为5分钟)。 取值范围[1~288] + EvaluationPeriods int32 `json:"evaluation_periods"` +} + +func (o Trigger) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "Trigger struct{}" + } + + return strings.Join([]string{"Trigger", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_update_cluster_scaling_request.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_update_cluster_scaling_request.go new file mode 100644 index 00000000..0ebfbc6c --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_update_cluster_scaling_request.go @@ -0,0 +1,25 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Request Object +type UpdateClusterScalingRequest struct { + + // 集群ID。获取方法,请参见[获取集群ID](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html)。 + ClusterId string `json:"cluster_id"` + + Body *ClusterScalingReq `json:"body,omitempty"` +} + +func (o UpdateClusterScalingRequest) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateClusterScalingRequest struct{}" + } + + return strings.Join([]string{"UpdateClusterScalingRequest", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_update_cluster_scaling_response.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_update_cluster_scaling_response.go new file mode 100644 index 00000000..8dcab7d2 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model/model_update_cluster_scaling_response.go @@ -0,0 +1,24 @@ +package model + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" + + "strings" +) + +// Response Object +type UpdateClusterScalingResponse struct { + + // 操作结果。 - succeeded:操作成功 - 操作失败时返回的错误码信息如[错误码](https://support.huaweicloud.com/api-mrs/ErrorCode.html)所示。 + Result *string `json:"result,omitempty"` + HttpStatusCode int `json:"-"` +} + +func (o UpdateClusterScalingResponse) String() string { + data, err := utils.Marshal(o) + if err != nil { + return "UpdateClusterScalingResponse struct{}" + } + + return strings.Join([]string{"UpdateClusterScalingResponse", string(data)}, " ") +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/mrs_client.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/mrs_client.go new file mode 100644 index 00000000..b5fa2412 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/mrs_client.go @@ -0,0 +1,436 @@ +package v1 + +import ( + http_client "github.com/huaweicloud/huaweicloud-sdk-go-v3/core" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/invoker" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model" +) + +type MrsClient struct { + HcClient *http_client.HcHttpClient +} + +func NewMrsClient(hcClient *http_client.HcHttpClient) *MrsClient { + return &MrsClient{HcClient: hcClient} +} + +func MrsClientBuilder() *http_client.HcHttpClientBuilder { + builder := http_client.NewHcHttpClientBuilder() + return builder +} + +// BatchCreateClusterTags 批量添加集群标签 +// +// 为指定集群批量添加标签。 +// +// 一个集群上最多有10个标签。 +// +// 此接口为幂等接口: +// +// - 创建时,同一个集群不允许重复key,如果数据库存在就覆盖。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) BatchCreateClusterTags(request *model.BatchCreateClusterTagsRequest) (*model.BatchCreateClusterTagsResponse, error) { + requestDef := GenReqDefForBatchCreateClusterTags() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.BatchCreateClusterTagsResponse), nil + } +} + +// BatchCreateClusterTagsInvoker 批量添加集群标签 +func (c *MrsClient) BatchCreateClusterTagsInvoker(request *model.BatchCreateClusterTagsRequest) *BatchCreateClusterTagsInvoker { + requestDef := GenReqDefForBatchCreateClusterTags() + return &BatchCreateClusterTagsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// BatchDeleteClusterTags 批量删除集群标签 +// +// 为指定集群批量删除标签。 +// +// 一个集群上最多有10个标签。 +// +// 此接口为幂等接口: +// +// - +// 删除时,如果删除的标签不存在,默认处理成功,删除时不对标签字符集范围做校验。Key长度36个unicode字符,value为43个unicode字符。删除时tags结构体不能缺失,key不能为空,或者空字符串。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) BatchDeleteClusterTags(request *model.BatchDeleteClusterTagsRequest) (*model.BatchDeleteClusterTagsResponse, error) { + requestDef := GenReqDefForBatchDeleteClusterTags() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.BatchDeleteClusterTagsResponse), nil + } +} + +// BatchDeleteClusterTagsInvoker 批量删除集群标签 +func (c *MrsClient) BatchDeleteClusterTagsInvoker(request *model.BatchDeleteClusterTagsRequest) *BatchDeleteClusterTagsInvoker { + requestDef := GenReqDefForBatchDeleteClusterTags() + return &BatchDeleteClusterTagsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// CreateAndExecuteJob 新增作业并执行(废弃) +// +// 如需使用作业管理接口请参考apiv2接口使用,本接口后续不再进行维护。 +// 在MRS集群中新增一个作业,并执行作业。该接口不兼容Sahara。 +// 集群ID可参考[查询集群列表](https://support.huaweicloud.com/api-mrs/ListClusters.html)接口获取。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) CreateAndExecuteJob(request *model.CreateAndExecuteJobRequest) (*model.CreateAndExecuteJobResponse, error) { + requestDef := GenReqDefForCreateAndExecuteJob() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.CreateAndExecuteJobResponse), nil + } +} + +// CreateAndExecuteJobInvoker 新增作业并执行(废弃) +func (c *MrsClient) CreateAndExecuteJobInvoker(request *model.CreateAndExecuteJobRequest) *CreateAndExecuteJobInvoker { + requestDef := GenReqDefForCreateAndExecuteJob() + return &CreateAndExecuteJobInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// CreateCluster 创建集群并执行作业 +// +// 创建一个MRS集群,并在集群中提交一个作业。该接口不兼容Sahara。 +// 支持同一时间并发创建10个集群。 +// 使用接口前,您需要先获取下的资源信息。 +// - 通过VPC创建或查询VPC、子网 +// - 通过ECS创建或查询密钥对 +// - 通过[终端节点](https://support.huaweicloud.com/api-mrs/mrs_02_0003.html)获取区域信息 +// - 参考[MRS服务支持的组件](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html)获取MRS版本及对应版本支持的组件信息 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) CreateCluster(request *model.CreateClusterRequest) (*model.CreateClusterResponse, error) { + requestDef := GenReqDefForCreateCluster() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.CreateClusterResponse), nil + } +} + +// CreateClusterInvoker 创建集群并执行作业 +func (c *MrsClient) CreateClusterInvoker(request *model.CreateClusterRequest) *CreateClusterInvoker { + requestDef := GenReqDefForCreateCluster() + return &CreateClusterInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// CreateClusterTag 给指定集群添加标签 +// +// 为特定的集群添加一个tag。 +// 一个集群上最多有10个标签,此接口为幂等接口。添加标签时,如果创建的标签已经存在(key相同),则覆盖。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) CreateClusterTag(request *model.CreateClusterTagRequest) (*model.CreateClusterTagResponse, error) { + requestDef := GenReqDefForCreateClusterTag() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.CreateClusterTagResponse), nil + } +} + +// CreateClusterTagInvoker 给指定集群添加标签 +func (c *MrsClient) CreateClusterTagInvoker(request *model.CreateClusterTagRequest) *CreateClusterTagInvoker { + requestDef := GenReqDefForCreateClusterTag() + return &CreateClusterTagInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// CreateScalingPolicy 配置弹性伸缩规则 +// +// 对弹性伸缩规则进行编辑。 +// +// 在创建集群并执行作业接口中也可以创建弹性伸缩规则。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) CreateScalingPolicy(request *model.CreateScalingPolicyRequest) (*model.CreateScalingPolicyResponse, error) { + requestDef := GenReqDefForCreateScalingPolicy() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.CreateScalingPolicyResponse), nil + } +} + +// CreateScalingPolicyInvoker 配置弹性伸缩规则 +func (c *MrsClient) CreateScalingPolicyInvoker(request *model.CreateScalingPolicyRequest) *CreateScalingPolicyInvoker { + requestDef := GenReqDefForCreateScalingPolicy() + return &CreateScalingPolicyInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeleteCluster 删除集群 +// +// 数据完成处理分析后或者集群运行异常无法提供服务时可删除集群服务。该接口兼容Sahara。 +// +// 处于如下状态的集群不允许删除: +// - scaling-out:扩容中 +// - scaling-in:缩容中 +// - starting:启动中 +// - terminating:删除中 +// - terminated:已删除 +// - failed:失败 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) DeleteCluster(request *model.DeleteClusterRequest) (*model.DeleteClusterResponse, error) { + requestDef := GenReqDefForDeleteCluster() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeleteClusterResponse), nil + } +} + +// DeleteClusterInvoker 删除集群 +func (c *MrsClient) DeleteClusterInvoker(request *model.DeleteClusterRequest) *DeleteClusterInvoker { + requestDef := GenReqDefForDeleteCluster() + return &DeleteClusterInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeleteClusterTag 删除指定集群的标签 +// +// 删除特定集群的标签。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) DeleteClusterTag(request *model.DeleteClusterTagRequest) (*model.DeleteClusterTagResponse, error) { + requestDef := GenReqDefForDeleteClusterTag() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeleteClusterTagResponse), nil + } +} + +// DeleteClusterTagInvoker 删除指定集群的标签 +func (c *MrsClient) DeleteClusterTagInvoker(request *model.DeleteClusterTagRequest) *DeleteClusterTagInvoker { + requestDef := GenReqDefForDeleteClusterTag() + return &DeleteClusterTagInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// DeleteJobExecution 删除作业执行对象(废弃) +// +// 如需使用作业管理接口请参考apiv2接口使用,本接口后续不再进行维护。 +// 删除指定的作业执行对象。该接口兼容Sahara。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) DeleteJobExecution(request *model.DeleteJobExecutionRequest) (*model.DeleteJobExecutionResponse, error) { + requestDef := GenReqDefForDeleteJobExecution() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.DeleteJobExecutionResponse), nil + } +} + +// DeleteJobExecutionInvoker 删除作业执行对象(废弃) +func (c *MrsClient) DeleteJobExecutionInvoker(request *model.DeleteJobExecutionRequest) *DeleteJobExecutionInvoker { + requestDef := GenReqDefForDeleteJobExecution() + return &DeleteJobExecutionInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListAllTags 查询所有标签 +// +// 查询租户在指定Region下的所有标签集合 。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) ListAllTags(request *model.ListAllTagsRequest) (*model.ListAllTagsResponse, error) { + requestDef := GenReqDefForListAllTags() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListAllTagsResponse), nil + } +} + +// ListAllTagsInvoker 查询所有标签 +func (c *MrsClient) ListAllTagsInvoker(request *model.ListAllTagsRequest) *ListAllTagsInvoker { + requestDef := GenReqDefForListAllTags() + return &ListAllTagsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListClusterTags 查询指定集群的标签 +// +// 查询指定集群的标签信息。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) ListClusterTags(request *model.ListClusterTagsRequest) (*model.ListClusterTagsResponse, error) { + requestDef := GenReqDefForListClusterTags() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListClusterTagsResponse), nil + } +} + +// ListClusterTagsInvoker 查询指定集群的标签 +func (c *MrsClient) ListClusterTagsInvoker(request *model.ListClusterTagsRequest) *ListClusterTagsInvoker { + requestDef := GenReqDefForListClusterTags() + return &ListClusterTagsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListClusters 查询集群列表 +// +// 查看用户创建的集群列表信息。该接口不兼容Sahara。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) ListClusters(request *model.ListClustersRequest) (*model.ListClustersResponse, error) { + requestDef := GenReqDefForListClusters() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListClustersResponse), nil + } +} + +// ListClustersInvoker 查询集群列表 +func (c *MrsClient) ListClustersInvoker(request *model.ListClustersRequest) *ListClustersInvoker { + requestDef := GenReqDefForListClusters() + return &ListClustersInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListClustersByTags 查询特定标签的集群列表 +// +// 使用标签过滤集群。 +// +// 集群默认按照创建时间倒序,集群tag也按照创建时间倒序。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) ListClustersByTags(request *model.ListClustersByTagsRequest) (*model.ListClustersByTagsResponse, error) { + requestDef := GenReqDefForListClustersByTags() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListClustersByTagsResponse), nil + } +} + +// ListClustersByTagsInvoker 查询特定标签的集群列表 +func (c *MrsClient) ListClustersByTagsInvoker(request *model.ListClustersByTagsRequest) *ListClustersByTagsInvoker { + requestDef := GenReqDefForListClustersByTags() + return &ListClustersByTagsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListExecuteJob 查询作业exe对象列表(废弃) +// +// 如需使用作业管理接口请参考apiv2接口使用,本接口后续不再进行维护。 +// 查询所有作业的exe对象列表。该接口不兼容Sahara。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) ListExecuteJob(request *model.ListExecuteJobRequest) (*model.ListExecuteJobResponse, error) { + requestDef := GenReqDefForListExecuteJob() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListExecuteJobResponse), nil + } +} + +// ListExecuteJobInvoker 查询作业exe对象列表(废弃) +func (c *MrsClient) ListExecuteJobInvoker(request *model.ListExecuteJobRequest) *ListExecuteJobInvoker { + requestDef := GenReqDefForListExecuteJob() + return &ListExecuteJobInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ListHosts 查询主机列表 +// +// 该接口用于查询输入集群的主机列表详情。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) ListHosts(request *model.ListHostsRequest) (*model.ListHostsResponse, error) { + requestDef := GenReqDefForListHosts() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ListHostsResponse), nil + } +} + +// ListHostsInvoker 查询主机列表 +func (c *MrsClient) ListHostsInvoker(request *model.ListHostsRequest) *ListHostsInvoker { + requestDef := GenReqDefForListHosts() + return &ListHostsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ShowClusterDetails 查询集群详情 +// +// 查看指定集群的详细信息。该接口不兼容Sahara。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) ShowClusterDetails(request *model.ShowClusterDetailsRequest) (*model.ShowClusterDetailsResponse, error) { + requestDef := GenReqDefForShowClusterDetails() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ShowClusterDetailsResponse), nil + } +} + +// ShowClusterDetailsInvoker 查询集群详情 +func (c *MrsClient) ShowClusterDetailsInvoker(request *model.ShowClusterDetailsRequest) *ShowClusterDetailsInvoker { + requestDef := GenReqDefForShowClusterDetails() + return &ShowClusterDetailsInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// ShowJobExes 查询作业exe对象详情(废弃) +// +// 如需使用作业管理接口请参考apiv2接口使用,本接口后续不再进行维护。 +// 查询指定作业的exe对象详细信息。该接口不兼容Sahara。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) ShowJobExes(request *model.ShowJobExesRequest) (*model.ShowJobExesResponse, error) { + requestDef := GenReqDefForShowJobExes() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.ShowJobExesResponse), nil + } +} + +// ShowJobExesInvoker 查询作业exe对象详情(废弃) +func (c *MrsClient) ShowJobExesInvoker(request *model.ShowJobExesRequest) *ShowJobExesInvoker { + requestDef := GenReqDefForShowJobExes() + return &ShowJobExesInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} + +// UpdateClusterScaling 调整集群节点 +// +// 创建集群后,扩容/缩容集群Core节点或者Task节点。MRS集群创建成功后不支持调整Master节点数量,即不支持扩缩容Master节点。该接口不兼容Sahara。 +// 处于running状态的集群才允许扩容/缩容,其他状态则不允许扩容/缩容。 集群状态和集群ID可参考[查询集群列表](https://support.huaweicloud.com/api-mrs/ListClusters.html)接口获取。 本章节的接口只支持流式集群、分析集群和混合集群,不支持自定义集群。 +// +// Please refer to HUAWEI cloud API Explorer for details. +func (c *MrsClient) UpdateClusterScaling(request *model.UpdateClusterScalingRequest) (*model.UpdateClusterScalingResponse, error) { + requestDef := GenReqDefForUpdateClusterScaling() + + if resp, err := c.HcClient.Sync(request, requestDef); err != nil { + return nil, err + } else { + return resp.(*model.UpdateClusterScalingResponse), nil + } +} + +// UpdateClusterScalingInvoker 调整集群节点 +func (c *MrsClient) UpdateClusterScalingInvoker(request *model.UpdateClusterScalingRequest) *UpdateClusterScalingInvoker { + requestDef := GenReqDefForUpdateClusterScaling() + return &UpdateClusterScalingInvoker{invoker.NewBaseInvoker(c.HcClient, request, requestDef)} +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/mrs_invoker.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/mrs_invoker.go new file mode 100644 index 00000000..51e7d0d7 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/mrs_invoker.go @@ -0,0 +1,222 @@ +package v1 + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/invoker" + "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model" +) + +type BatchCreateClusterTagsInvoker struct { + *invoker.BaseInvoker +} + +func (i *BatchCreateClusterTagsInvoker) Invoke() (*model.BatchCreateClusterTagsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.BatchCreateClusterTagsResponse), nil + } +} + +type BatchDeleteClusterTagsInvoker struct { + *invoker.BaseInvoker +} + +func (i *BatchDeleteClusterTagsInvoker) Invoke() (*model.BatchDeleteClusterTagsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.BatchDeleteClusterTagsResponse), nil + } +} + +type CreateAndExecuteJobInvoker struct { + *invoker.BaseInvoker +} + +func (i *CreateAndExecuteJobInvoker) Invoke() (*model.CreateAndExecuteJobResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.CreateAndExecuteJobResponse), nil + } +} + +type CreateClusterInvoker struct { + *invoker.BaseInvoker +} + +func (i *CreateClusterInvoker) Invoke() (*model.CreateClusterResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.CreateClusterResponse), nil + } +} + +type CreateClusterTagInvoker struct { + *invoker.BaseInvoker +} + +func (i *CreateClusterTagInvoker) Invoke() (*model.CreateClusterTagResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.CreateClusterTagResponse), nil + } +} + +type CreateScalingPolicyInvoker struct { + *invoker.BaseInvoker +} + +func (i *CreateScalingPolicyInvoker) Invoke() (*model.CreateScalingPolicyResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.CreateScalingPolicyResponse), nil + } +} + +type DeleteClusterInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeleteClusterInvoker) Invoke() (*model.DeleteClusterResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeleteClusterResponse), nil + } +} + +type DeleteClusterTagInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeleteClusterTagInvoker) Invoke() (*model.DeleteClusterTagResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeleteClusterTagResponse), nil + } +} + +type DeleteJobExecutionInvoker struct { + *invoker.BaseInvoker +} + +func (i *DeleteJobExecutionInvoker) Invoke() (*model.DeleteJobExecutionResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.DeleteJobExecutionResponse), nil + } +} + +type ListAllTagsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListAllTagsInvoker) Invoke() (*model.ListAllTagsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListAllTagsResponse), nil + } +} + +type ListClusterTagsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListClusterTagsInvoker) Invoke() (*model.ListClusterTagsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListClusterTagsResponse), nil + } +} + +type ListClustersInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListClustersInvoker) Invoke() (*model.ListClustersResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListClustersResponse), nil + } +} + +type ListClustersByTagsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListClustersByTagsInvoker) Invoke() (*model.ListClustersByTagsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListClustersByTagsResponse), nil + } +} + +type ListExecuteJobInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListExecuteJobInvoker) Invoke() (*model.ListExecuteJobResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListExecuteJobResponse), nil + } +} + +type ListHostsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ListHostsInvoker) Invoke() (*model.ListHostsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ListHostsResponse), nil + } +} + +type ShowClusterDetailsInvoker struct { + *invoker.BaseInvoker +} + +func (i *ShowClusterDetailsInvoker) Invoke() (*model.ShowClusterDetailsResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ShowClusterDetailsResponse), nil + } +} + +type ShowJobExesInvoker struct { + *invoker.BaseInvoker +} + +func (i *ShowJobExesInvoker) Invoke() (*model.ShowJobExesResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.ShowJobExesResponse), nil + } +} + +type UpdateClusterScalingInvoker struct { + *invoker.BaseInvoker +} + +func (i *UpdateClusterScalingInvoker) Invoke() (*model.UpdateClusterScalingResponse, error) { + if result, err := i.BaseInvoker.Invoke(); err != nil { + return nil, err + } else { + return result.(*model.UpdateClusterScalingResponse), nil + } +} diff --git a/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/mrs_meta.go b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/mrs_meta.go new file mode 100644 index 00000000..cf4a5978 --- /dev/null +++ b/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/mrs_meta.go @@ -0,0 +1,369 @@ +package v1 + +import ( + "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/def" + + "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model" + "net/http" +) + +func GenReqDefForBatchCreateClusterTags() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1.1/{project_id}/clusters/{cluster_id}/tags/action"). + WithResponse(new(model.BatchCreateClusterTagsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterId"). + WithJsonTag("cluster_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForBatchDeleteClusterTags() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1.1/{project_id}/clusters/{cluster_id}/tags/action"). + WithResponse(new(model.BatchDeleteClusterTagsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterId"). + WithJsonTag("cluster_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForCreateAndExecuteJob() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1.1/{project_id}/jobs/submit-job"). + WithResponse(new(model.CreateAndExecuteJobResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForCreateCluster() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1.1/{project_id}/run-job-flow"). + WithResponse(new(model.CreateClusterResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForCreateClusterTag() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1.1/{project_id}/clusters/{cluster_id}/tags"). + WithResponse(new(model.CreateClusterTagResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterId"). + WithJsonTag("cluster_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForCreateScalingPolicy() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1.1/{project_id}/autoscaling-policy/{cluster_id}"). + WithResponse(new(model.CreateScalingPolicyResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterId"). + WithJsonTag("cluster_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeleteCluster() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodDelete). + WithPath("/v1.1/{project_id}/clusters/{cluster_id}"). + WithResponse(new(model.DeleteClusterResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterId"). + WithJsonTag("cluster_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithResponseField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeleteClusterTag() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodDelete). + WithPath("/v1.1/{project_id}/clusters/{cluster_id}/tags/{key}"). + WithResponse(new(model.DeleteClusterTagResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterId"). + WithJsonTag("cluster_id"). + WithLocationType(def.Path)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Key"). + WithJsonTag("key"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForDeleteJobExecution() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodDelete). + WithPath("/v1.1/{project_id}/job-executions/{job_execution_id}"). + WithResponse(new(model.DeleteJobExecutionResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("JobExecutionId"). + WithJsonTag("job_execution_id"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListAllTags() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1.1/{project_id}/clusters/tags"). + WithResponse(new(model.ListAllTagsResponse)). + WithContentType("application/json") + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListClusterTags() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1.1/{project_id}/clusters/{cluster_id}/tags"). + WithResponse(new(model.ListClusterTagsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterId"). + WithJsonTag("cluster_id"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListClusters() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1.1/{project_id}/cluster_infos"). + WithResponse(new(model.ListClustersResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Tags"). + WithJsonTag("tags"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("PageSize"). + WithJsonTag("pageSize"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CurrentPage"). + WithJsonTag("currentPage"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterName"). + WithJsonTag("clusterName"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterState"). + WithJsonTag("clusterState"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("EnterpriseProjectId"). + WithJsonTag("enterpriseProjectId"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListClustersByTags() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPost). + WithPath("/v1.1/{project_id}/clusters/resource_instances/action"). + WithResponse(new(model.ListClustersByTagsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListExecuteJob() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1.1/{project_id}/job-exes"). + WithResponse(new(model.ListExecuteJobResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("PageSize"). + WithJsonTag("page_size"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CurrentPage"). + WithJsonTag("current_page"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("JobName"). + WithJsonTag("job_name"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterId"). + WithJsonTag("cluster_id"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("State"). + WithJsonTag("state"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Id"). + WithJsonTag("id"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForListHosts() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1.1/{project_id}/clusters/{cluster_id}/hosts"). + WithResponse(new(model.ListHostsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterId"). + WithJsonTag("cluster_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("PageSize"). + WithJsonTag("pageSize"). + WithLocationType(def.Query)) + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("CurrentPage"). + WithJsonTag("currentPage"). + WithLocationType(def.Query)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForShowClusterDetails() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1.1/{project_id}/cluster_infos/{cluster_id}"). + WithResponse(new(model.ShowClusterDetailsResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterId"). + WithJsonTag("cluster_id"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForShowJobExes() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodGet). + WithPath("/v1.1/{project_id}/job-exes/{job_exe_id}"). + WithResponse(new(model.ShowJobExesResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("JobExeId"). + WithJsonTag("job_exe_id"). + WithLocationType(def.Path)) + + requestDef := reqDefBuilder.Build() + return requestDef +} + +func GenReqDefForUpdateClusterScaling() *def.HttpRequestDef { + reqDefBuilder := def.NewHttpRequestDefBuilder(). + WithMethod(http.MethodPut). + WithPath("/v1.1/{project_id}/cluster_infos/{cluster_id}"). + WithResponse(new(model.UpdateClusterScalingResponse)). + WithContentType("application/json") + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("ClusterId"). + WithJsonTag("cluster_id"). + WithLocationType(def.Path)) + + reqDefBuilder.WithRequestField(def.NewFieldDef(). + WithName("Body"). + WithLocationType(def.Body)) + + requestDef := reqDefBuilder.Build() + return requestDef +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 523064d6..e690b962 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -66,6 +66,10 @@ github.com/huaweicloud/huaweicloud-sdk-go-v3/services/gaussdbforopengauss/v3 github.com/huaweicloud/huaweicloud-sdk-go-v3/services/gaussdbforopengauss/v3/model github.com/huaweicloud/huaweicloud-sdk-go-v3/services/iam/v3 github.com/huaweicloud/huaweicloud-sdk-go-v3/services/iam/v3/model +github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1 +github.com/huaweicloud/huaweicloud-sdk-go-v3/services/lakeformation/v1/model +github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1 +github.com/huaweicloud/huaweicloud-sdk-go-v3/services/mrs/v1/model github.com/huaweicloud/huaweicloud-sdk-go-v3/services/rms/v1 github.com/huaweicloud/huaweicloud-sdk-go-v3/services/rms/v1/model github.com/huaweicloud/huaweicloud-sdk-go-v3/services/rms/v1/region