You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by lp...@apache.org on 2017/06/27 13:16:01 UTC
[1/2] ambari git commit: AMBARI-21307 Create new rest resource for
ambari configuration
Repository: ambari
Updated Branches:
refs/heads/feature-branch-AMBARI-21307 [created] c954b026e
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/resources/properties.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/properties.json b/ambari-server/src/main/resources/properties.json
index 11ca7f6..cb6d582 100644
--- a/ambari-server/src/main/resources/properties.json
+++ b/ambari-server/src/main/resources/properties.json
@@ -1,484 +1,490 @@
{
- "Cluster":[
- "Clusters/cluster_id",
- "Clusters/cluster_name",
- "Clusters/provisioning_state",
- "Clusters/security_type",
- "Clusters/version",
- "Clusters/state",
- "Clusters/desired_configs",
- "Clusters/desired_service_config_versions",
- "Clusters/total_hosts",
- "Clusters/health_report",
- "_"
- ],
- "Host":[
- "Hosts/cluster_name",
- "Hosts/host_name",
- "Hosts/ip",
- "Hosts/attributes",
- "Hosts/total_mem",
- "Hosts/cpu_count",
- "Hosts/ph_cpu_count",
- "Hosts/os_arch",
- "Hosts/os_type",
- "Hosts/os_family",
- "Hosts/rack_info",
- "Hosts/last_heartbeat_time",
- "Hosts/last_agent_env",
- "Hosts/last_registration_time",
- "Hosts/disk_info",
- "Hosts/host_status",
- "Hosts/host_health_report",
- "Hosts/public_host_name",
- "Hosts/host_state",
- "Hosts/maintenance_state",
- "Hosts/desired_configs",
- "Hosts/recovery_report",
- "Hosts/recovery_summary",
- "_"
- ],
- "HostComponent":[
- "HostRoles/role_id",
- "HostRoles/cluster_name",
- "HostRoles/host_name",
- "HostRoles/public_host_name",
- "HostRoles/component_name",
- "HostRoles/display_name",
- "HostRoles/state",
- "HostRoles/desired_state",
- "HostRoles/version",
- "HostRoles/desired_stack_id",
- "HostRoles/desired_repository_version",
- "HostRoles/actual_configs",
- "params/run_smoke_test",
- "HostRoles/stale_configs",
- "HostRoles/desired_admin_state",
- "HostRoles/maintenance_state",
- "HostRoles/service_name",
- "HostRoles/upgrade_state",
- "_"
- ],
- "ConfigGroup": [
- "ConfigGroup/id",
- "ConfigGroup/cluster_name",
- "ConfigGroup/group_name",
- "ConfigGroup/tag",
- "ConfigGroup/description",
- "ConfigGroup/hosts",
- "ConfigGroup/desired_configs"
- ],
- "Action":[
- "Actions/action_name",
- "Actions/action_type",
- "Actions/inputs",
- "Actions/target_service",
- "Actions/target_component",
- "Actions/description",
- "Actions/target_type",
- "Actions/default_timeout",
- "_"
- ],
- "Request":[
- "Requests/id",
- "Requests/cluster_name",
- "Requests/request_status",
- "Requests/request_context",
- "Requests/request_schedule",
- "Requests/type",
- "Requests/inputs",
- "Requests/resource_filters",
- "Requests/operation_level",
- "Requests/create_time",
- "Requests/start_time",
- "Requests/end_time",
- "Requests/exclusive",
- "Requests/task_count",
- "Requests/failed_task_count",
- "Requests/aborted_task_count",
- "Requests/timed_out_task_count",
- "Requests/completed_task_count",
- "Requests/queued_task_count",
- "Requests/progress_percent",
- "Requests/abort_reason",
- "Requests/remove_pending_host_requests",
- "Requests/pending_host_request_count",
- "Requests/cluster_host_info",
- "_"
- ],
- "RequestSchedule" : [
- "RequestSchedule/id",
- "RequestSchedule/cluster_name",
- "RequestSchedule/description",
- "RequestSchedule/status",
- "RequestSchedule/last_execution_status",
- "RequestSchedule/batch",
- "RequestSchedule/schedule",
- "_"
- ],
- "Task":[
- "Tasks/id",
- "Tasks/request_id",
- "Tasks/cluster_name",
- "Tasks/stage_id",
- "Tasks/host_name",
- "Tasks/role",
- "Tasks/command",
- "Tasks/status",
- "Tasks/exit_code",
- "Tasks/stderr",
- "Tasks/stdout",
- "Tasks/output_log",
- "Tasks/error_log",
- "Tasks/start_time",
- "Tasks/end_time",
- "Tasks/structured_out",
- "Tasks/attempt_cnt",
- "Tasks/custom_command_name",
- "Tasks/command_detail",
- "Tasks/ops_display_name",
- "_"
- ],
- "User":[
- "Users/user_name",
- "Users/password",
- "Users/old_password",
- "Users/ldap_user",
- "Users/user_type",
- "Users/active",
- "Users/groups",
- "Users/admin",
- "_"
- ],
- "Group":[
- "Groups/group_name",
- "Groups/ldap_group",
- "Groups/group_type",
- "_"
- ],
- "Member":[
- "MemberInfo/group_name",
- "MemberInfo/user_name",
- "_"
- ],
- "Stack":[
- "Stacks/stack_name",
- "_"
- ],
- "StackVersion":[
- "Versions/stack_name",
- "Versions/stack_version",
- "Versions/min_upgrade_version",
- "Versions/active",
- "Versions/valid",
- "Versions/stack-errors",
- "Versions/parent_stack_version",
- "Versions/config_types",
- "Versions/upgrade_packs",
- "_"
- ],
- "StackService":[
- "StackServices/stack_name",
- "StackServices/stack_version",
- "StackServices/service_name",
- "StackServices/display_name",
- "StackServices/selection",
- "StackServices/user_name",
- "StackServices/comments",
- "StackServices/service_version",
- "StackServices/config_types",
- "StackServices/service_check_supported",
- "StackServices/custom_commands",
- "StackServices/required_services",
- "StackServices/credential_store_supported",
- "StackServices/credential_store_enabled",
- "StackServices/credential_store_required",
- "StackServices/properties",
- "StackServices/support_delete_via_ui",
- "_"
- ],
- "StackConfiguration":[
- "StackConfigurations/stack_name",
- "StackConfigurations/stack_version",
- "StackConfigurations/service_name",
- "StackConfigurations/property_name",
- "StackConfigurations/property_value",
- "StackConfigurations/property_value_attributes",
- "StackConfigurations/property_depends_on",
- "StackConfigurations/property_description",
- "StackConfigurations/property_display_name",
- "StackConfigurations/type",
- "StackConfigurations/final",
- "StackConfigurations/adding_forbidden",
- "StackConfigurations/do_not_extend",
- "StackConfigurations/property_type",
- "_"
- ],
- "StackServiceComponent":[
- "StackServiceComponents/stack_name",
- "StackServiceComponents/stack_version",
- "StackServiceComponents/service_name",
- "StackServiceComponents/component_name",
- "StackServiceComponents/display_name",
- "StackServiceComponents/component_category",
- "StackServiceComponents/is_client",
- "StackServiceComponents/is_master",
- "StackServiceComponents/cardinality",
- "StackServiceComponents/custom_commands",
- "StackServiceComponents/recovery_enabled",
- "StackServiceComponents/advertise_version",
- "StackServiceComponents/decommission_allowed",
- "StackServiceComponents/reassign_allowed",
- "StackServiceComponents/has_bulk_commands_definition",
- "StackServiceComponents/bulk_commands_display_name",
- "StackServiceComponents/bulk_commands_master_component_name",
- "auto_deploy/enabled",
- "auto_deploy/location",
- "_"
- ],
- "StackServiceComponentDependency" :[
- "Dependencies/stack_name",
- "Dependencies/stack_version",
- "Dependencies/dependent_service_name",
- "Dependencies/dependent_component_name",
- "Dependencies/service_name",
- "Dependencies/component_name",
- "Dependencies/scope",
- "Dependencies/conditions",
- "auto_deploy/enabled",
- "auto_deploy/location"
- ],
- "ExtensionLink": [
- "ExtensionLink/link_id",
- "ExtensionLink/stack_name",
- "ExtensionLink/stack_version",
- "ExtensionLink/extension_name",
- "ExtensionLink/extension_version",
- "_"
- ],
- "Extension":[
- "Extensions/extension_name",
- "_"
- ],
- "ExtensionVersion":[
- "Versions/extension_name",
- "Versions/extension_version",
- "Versions/valid",
- "Versions/extension-errors",
- "Versions/parent_extension_version",
- "_"
- ],
- "DRFeed":[
- "Feed/name",
- "Feed/description",
- "Feed/status",
- "Feed/frequency",
- "Feed/sourceCluster",
- "Feed/targetCluster",
- "Feed/properties"
- ],
- "DRTargetCluster":[
- "Cluster/name",
- "Cluster/colo",
- "Cluster/interfaces",
- "Cluster/locations",
- "Cluster/properties"
- ],
- "DRInstance":[
- "Instance/feedName",
- "Instance/id",
- "Instance/status",
- "Instance/startTime",
- "Instance/endTime",
- "Instance/details",
- "Instance/log"
- ],
- "Workflow":[
- "Workflow/cluster_name",
- "Workflow/workflow_id",
- "Workflow/name",
- "Workflow/user_name",
- "Workflow/start_time",
- "Workflow/last_update_time",
- "Workflow/elapsed_time",
- "Workflow/input_bytes",
- "Workflow/output_bytes",
- "Workflow/num_jobs_total",
- "Workflow/num_jobs_completed",
- "Workflow/parent_id",
- "Workflow/context"
- ],
- "Job":[
- "Job/cluster_name",
- "Job/workflow_id",
- "Job/job_id",
- "Job/name",
- "Job/status",
- "Job/user_name",
- "Job/submit_time",
- "Job/elapsed_time",
- "Job/maps",
- "Job/reduces",
- "Job/input_bytes",
- "Job/output_bytes",
- "Job/conf_path",
- "Job/workflow_entity_name"
- ],
- "TaskAttempt":[
- "TaskAttempt/cluster_name",
- "TaskAttempt/workflow_id",
- "TaskAttempt/job_id",
- "TaskAttempt/task_attempt_id",
- "TaskAttempt/type",
- "TaskAttempt/start_time",
- "TaskAttempt/finish_time",
- "TaskAttempt/map_finish_time",
- "TaskAttempt/shuffle_finish_time",
- "TaskAttempt/sort_finish_fime",
- "TaskAttempt/input_bytes",
- "TaskAttempt/output_bytes",
- "TaskAttempt/status",
- "TaskAttempt/locality"
- ],
- "RootService":[
- "RootService/service_name"
- ],
- "RootServiceComponent":[
- "RootServiceComponents/service_name",
- "RootServiceComponents/component_name",
- "RootServiceComponents/properties",
- "RootServiceComponents/component_version",
- "RootServiceComponents/server_clock"
- ],
- "RootServiceHostComponent":[
- "RootServiceHostComponents/service_name",
- "RootServiceHostComponents/component_name",
- "RootServiceHostComponents/host_name",
- "RootServiceHostComponents/component_state",
- "RootServiceHostComponents/component_version",
- "RootServiceHostComponents/properties"
- ],
- "Blueprint":[
- "Blueprints/blueprint_name",
- "Blueprints/stack_name",
- "Blueprints/stack_version",
- "Blueprints/security",
- "host_groups",
- "host_groups/components",
- "host_groups/cardinality",
- "configurations",
- "validate_topology",
- "settings"
- ],
- "Recommendation":[
- "Recommendation/id",
- "Versions/stack_name",
- "Versions/stack_version",
- "recommend",
- "hosts",
- "services",
- "changed_configurations",
- "user_context",
- "user_context/operation",
- "user_context/operation_details",
- "recommendations",
- "recommendations/blueprint",
- "recommendations/blueprint/configurations",
- "recommendations/blueprint/host_groups",
- "recommendations/blueprint/host_groups/name",
- "recommendations/blueprint/host_groups/components",
- "recommendations/blueprint_cluster_binding",
- "recommendations/blueprint_cluster_binding/host_groups",
- "recommendations/blueprint_cluster_binding/host_groups/name",
- "recommendations/blueprint_cluster_binding/host_groups/hosts",
- "recommendations/config_groups"
- ],
- "Validation":[
- "Validation/id",
- "Versions/stack_name",
- "Versions/stack_version",
- "items",
- "items/type",
- "items/level",
- "items/message",
- "items/component-name",
- "items/host",
- "items/config-type",
- "items/config-name",
- "items/host-group",
- "validate",
- "hosts",
- "services",
- "recommendations"
- ],
- "HostComponentProcess": [
- "HostComponentProcess/cluster_name",
- "HostComponentProcess/host_name",
- "HostComponentProcess/component_name",
- "HostComponentProcess/name",
- "HostComponentProcess/status"
- ],
- "ClientConfig":[
- "ServiceComponentInfo/service_name",
- "ServiceComponentInfo/component_name",
- "ServiceComponentInfo/cluster_name",
- "HostRoles/host_name",
- "_"
- ],
- "Widget":[
- "WidgetInfo/id",
- "WidgetInfo/cluster_name",
- "WidgetInfo/widget_name",
- "WidgetInfo/display_name",
- "WidgetInfo/widget_type",
- "WidgetInfo/time_created",
- "WidgetInfo/author",
- "WidgetInfo/description",
- "WidgetInfo/scope",
- "WidgetInfo/metrics",
- "WidgetInfo/values",
- "WidgetInfo/properties",
- "_"
- ],
- "WidgetLayout":[
- "WidgetLayoutInfo/id",
- "WidgetLayoutInfo/section_name",
- "WidgetLayoutInfo/cluster_name",
- "WidgetLayoutInfo/layout_name",
- "WidgetLayoutInfo/display_name",
- "WidgetLayoutInfo/scope",
- "WidgetLayoutInfo/user_name",
- "WidgetLayoutInfo/WidgetsInfo",
- "User/user_name",
- "_"
- ],
- "StackLevelConfiguration":[
- "StackLevelConfigurations/stack_name",
- "StackLevelConfigurations/stack_version",
- "StackLevelConfigurations/property_name",
- "StackLevelConfigurations/property_value",
- "StackLevelConfigurations/property_display_name",
- "StackLevelConfigurations/property_value_attributes",
- "StackLevelConfigurations/property_depends_on",
- "StackLevelConfigurations/property_description",
- "StackLevelConfigurations/type",
- "StackLevelConfigurations/final",
- "StackLevelConfigurations/property_type",
- "_"
- ],
- "StackConfigurationDependency":[
- "StackConfigurationDependency/stack_name",
- "StackConfigurationDependency/stack_version",
- "StackConfigurationDependency/service_name",
- "StackConfigurationDependency/property_name",
- "StackConfigurationDependency/dependency_type",
- "StackConfigurationDependency/dependency_name",
- "_"
- ],
- "KerberosDescriptor":[
- "KerberosDescriptors/kerberos_descriptor_name",
- "KerberosDescriptors/kerberos_descriptor_text",
- "_"
- ]
-
+ "Cluster": [
+ "Clusters/cluster_id",
+ "Clusters/cluster_name",
+ "Clusters/provisioning_state",
+ "Clusters/security_type",
+ "Clusters/version",
+ "Clusters/state",
+ "Clusters/desired_configs",
+ "Clusters/desired_service_config_versions",
+ "Clusters/total_hosts",
+ "Clusters/health_report",
+ "_"
+ ],
+ "Host": [
+ "Hosts/cluster_name",
+ "Hosts/host_name",
+ "Hosts/ip",
+ "Hosts/attributes",
+ "Hosts/total_mem",
+ "Hosts/cpu_count",
+ "Hosts/ph_cpu_count",
+ "Hosts/os_arch",
+ "Hosts/os_type",
+ "Hosts/os_family",
+ "Hosts/rack_info",
+ "Hosts/last_heartbeat_time",
+ "Hosts/last_agent_env",
+ "Hosts/last_registration_time",
+ "Hosts/disk_info",
+ "Hosts/host_status",
+ "Hosts/host_health_report",
+ "Hosts/public_host_name",
+ "Hosts/host_state",
+ "Hosts/maintenance_state",
+ "Hosts/desired_configs",
+ "Hosts/recovery_report",
+ "Hosts/recovery_summary",
+ "_"
+ ],
+ "HostComponent": [
+ "HostRoles/role_id",
+ "HostRoles/cluster_name",
+ "HostRoles/host_name",
+ "HostRoles/public_host_name",
+ "HostRoles/component_name",
+ "HostRoles/display_name",
+ "HostRoles/state",
+ "HostRoles/desired_state",
+ "HostRoles/version",
+ "HostRoles/desired_stack_id",
+ "HostRoles/desired_repository_version",
+ "HostRoles/actual_configs",
+ "params/run_smoke_test",
+ "HostRoles/stale_configs",
+ "HostRoles/desired_admin_state",
+ "HostRoles/maintenance_state",
+ "HostRoles/service_name",
+ "HostRoles/upgrade_state",
+ "_"
+ ],
+ "ConfigGroup": [
+ "ConfigGroup/id",
+ "ConfigGroup/cluster_name",
+ "ConfigGroup/group_name",
+ "ConfigGroup/tag",
+ "ConfigGroup/description",
+ "ConfigGroup/hosts",
+ "ConfigGroup/desired_configs"
+ ],
+ "Action": [
+ "Actions/action_name",
+ "Actions/action_type",
+ "Actions/inputs",
+ "Actions/target_service",
+ "Actions/target_component",
+ "Actions/description",
+ "Actions/target_type",
+ "Actions/default_timeout",
+ "_"
+ ],
+ "Request": [
+ "Requests/id",
+ "Requests/cluster_name",
+ "Requests/request_status",
+ "Requests/request_context",
+ "Requests/request_schedule",
+ "Requests/type",
+ "Requests/inputs",
+ "Requests/resource_filters",
+ "Requests/operation_level",
+ "Requests/create_time",
+ "Requests/start_time",
+ "Requests/end_time",
+ "Requests/exclusive",
+ "Requests/task_count",
+ "Requests/failed_task_count",
+ "Requests/aborted_task_count",
+ "Requests/timed_out_task_count",
+ "Requests/completed_task_count",
+ "Requests/queued_task_count",
+ "Requests/progress_percent",
+ "Requests/abort_reason",
+ "Requests/remove_pending_host_requests",
+ "Requests/pending_host_request_count",
+ "Requests/cluster_host_info",
+ "_"
+ ],
+ "RequestSchedule": [
+ "RequestSchedule/id",
+ "RequestSchedule/cluster_name",
+ "RequestSchedule/description",
+ "RequestSchedule/status",
+ "RequestSchedule/last_execution_status",
+ "RequestSchedule/batch",
+ "RequestSchedule/schedule",
+ "_"
+ ],
+ "Task": [
+ "Tasks/id",
+ "Tasks/request_id",
+ "Tasks/cluster_name",
+ "Tasks/stage_id",
+ "Tasks/host_name",
+ "Tasks/role",
+ "Tasks/command",
+ "Tasks/status",
+ "Tasks/exit_code",
+ "Tasks/stderr",
+ "Tasks/stdout",
+ "Tasks/output_log",
+ "Tasks/error_log",
+ "Tasks/start_time",
+ "Tasks/end_time",
+ "Tasks/structured_out",
+ "Tasks/attempt_cnt",
+ "Tasks/custom_command_name",
+ "Tasks/command_detail",
+ "Tasks/ops_display_name",
+ "_"
+ ],
+ "User": [
+ "Users/user_name",
+ "Users/password",
+ "Users/old_password",
+ "Users/ldap_user",
+ "Users/user_type",
+ "Users/active",
+ "Users/groups",
+ "Users/admin",
+ "_"
+ ],
+ "Group": [
+ "Groups/group_name",
+ "Groups/ldap_group",
+ "Groups/group_type",
+ "_"
+ ],
+ "Member": [
+ "MemberInfo/group_name",
+ "MemberInfo/user_name",
+ "_"
+ ],
+ "Stack": [
+ "Stacks/stack_name",
+ "_"
+ ],
+ "StackVersion": [
+ "Versions/stack_name",
+ "Versions/stack_version",
+ "Versions/min_upgrade_version",
+ "Versions/active",
+ "Versions/valid",
+ "Versions/stack-errors",
+ "Versions/parent_stack_version",
+ "Versions/config_types",
+ "Versions/upgrade_packs",
+ "_"
+ ],
+ "StackService": [
+ "StackServices/stack_name",
+ "StackServices/stack_version",
+ "StackServices/service_name",
+ "StackServices/display_name",
+ "StackServices/selection",
+ "StackServices/user_name",
+ "StackServices/comments",
+ "StackServices/service_version",
+ "StackServices/config_types",
+ "StackServices/service_check_supported",
+ "StackServices/custom_commands",
+ "StackServices/required_services",
+ "StackServices/credential_store_supported",
+ "StackServices/credential_store_enabled",
+ "StackServices/credential_store_required",
+ "StackServices/properties",
+ "StackServices/support_delete_via_ui",
+ "_"
+ ],
+ "StackConfiguration": [
+ "StackConfigurations/stack_name",
+ "StackConfigurations/stack_version",
+ "StackConfigurations/service_name",
+ "StackConfigurations/property_name",
+ "StackConfigurations/property_value",
+ "StackConfigurations/property_value_attributes",
+ "StackConfigurations/property_depends_on",
+ "StackConfigurations/property_description",
+ "StackConfigurations/property_display_name",
+ "StackConfigurations/type",
+ "StackConfigurations/final",
+ "StackConfigurations/adding_forbidden",
+ "StackConfigurations/do_not_extend",
+ "StackConfigurations/property_type",
+ "_"
+ ],
+ "StackServiceComponent": [
+ "StackServiceComponents/stack_name",
+ "StackServiceComponents/stack_version",
+ "StackServiceComponents/service_name",
+ "StackServiceComponents/component_name",
+ "StackServiceComponents/display_name",
+ "StackServiceComponents/component_category",
+ "StackServiceComponents/is_client",
+ "StackServiceComponents/is_master",
+ "StackServiceComponents/cardinality",
+ "StackServiceComponents/custom_commands",
+ "StackServiceComponents/recovery_enabled",
+ "StackServiceComponents/advertise_version",
+ "StackServiceComponents/decommission_allowed",
+ "StackServiceComponents/reassign_allowed",
+ "StackServiceComponents/has_bulk_commands_definition",
+ "StackServiceComponents/bulk_commands_display_name",
+ "StackServiceComponents/bulk_commands_master_component_name",
+ "auto_deploy/enabled",
+ "auto_deploy/location",
+ "_"
+ ],
+ "StackServiceComponentDependency": [
+ "Dependencies/stack_name",
+ "Dependencies/stack_version",
+ "Dependencies/dependent_service_name",
+ "Dependencies/dependent_component_name",
+ "Dependencies/service_name",
+ "Dependencies/component_name",
+ "Dependencies/scope",
+ "Dependencies/conditions",
+ "auto_deploy/enabled",
+ "auto_deploy/location"
+ ],
+ "ExtensionLink": [
+ "ExtensionLink/link_id",
+ "ExtensionLink/stack_name",
+ "ExtensionLink/stack_version",
+ "ExtensionLink/extension_name",
+ "ExtensionLink/extension_version",
+ "_"
+ ],
+ "Extension": [
+ "Extensions/extension_name",
+ "_"
+ ],
+ "ExtensionVersion": [
+ "Versions/extension_name",
+ "Versions/extension_version",
+ "Versions/valid",
+ "Versions/extension-errors",
+ "Versions/parent_extension_version",
+ "_"
+ ],
+ "DRFeed": [
+ "Feed/name",
+ "Feed/description",
+ "Feed/status",
+ "Feed/frequency",
+ "Feed/sourceCluster",
+ "Feed/targetCluster",
+ "Feed/properties"
+ ],
+ "DRTargetCluster": [
+ "Cluster/name",
+ "Cluster/colo",
+ "Cluster/interfaces",
+ "Cluster/locations",
+ "Cluster/properties"
+ ],
+ "DRInstance": [
+ "Instance/feedName",
+ "Instance/id",
+ "Instance/status",
+ "Instance/startTime",
+ "Instance/endTime",
+ "Instance/details",
+ "Instance/log"
+ ],
+ "Workflow": [
+ "Workflow/cluster_name",
+ "Workflow/workflow_id",
+ "Workflow/name",
+ "Workflow/user_name",
+ "Workflow/start_time",
+ "Workflow/last_update_time",
+ "Workflow/elapsed_time",
+ "Workflow/input_bytes",
+ "Workflow/output_bytes",
+ "Workflow/num_jobs_total",
+ "Workflow/num_jobs_completed",
+ "Workflow/parent_id",
+ "Workflow/context"
+ ],
+ "Job": [
+ "Job/cluster_name",
+ "Job/workflow_id",
+ "Job/job_id",
+ "Job/name",
+ "Job/status",
+ "Job/user_name",
+ "Job/submit_time",
+ "Job/elapsed_time",
+ "Job/maps",
+ "Job/reduces",
+ "Job/input_bytes",
+ "Job/output_bytes",
+ "Job/conf_path",
+ "Job/workflow_entity_name"
+ ],
+ "TaskAttempt": [
+ "TaskAttempt/cluster_name",
+ "TaskAttempt/workflow_id",
+ "TaskAttempt/job_id",
+ "TaskAttempt/task_attempt_id",
+ "TaskAttempt/type",
+ "TaskAttempt/start_time",
+ "TaskAttempt/finish_time",
+ "TaskAttempt/map_finish_time",
+ "TaskAttempt/shuffle_finish_time",
+ "TaskAttempt/sort_finish_fime",
+ "TaskAttempt/input_bytes",
+ "TaskAttempt/output_bytes",
+ "TaskAttempt/status",
+ "TaskAttempt/locality"
+ ],
+ "RootService": [
+ "RootService/service_name"
+ ],
+ "RootServiceComponent": [
+ "RootServiceComponents/service_name",
+ "RootServiceComponents/component_name",
+ "RootServiceComponents/properties",
+ "RootServiceComponents/component_version",
+ "RootServiceComponents/server_clock"
+ ],
+ "RootServiceHostComponent": [
+ "RootServiceHostComponents/service_name",
+ "RootServiceHostComponents/component_name",
+ "RootServiceHostComponents/host_name",
+ "RootServiceHostComponents/component_state",
+ "RootServiceHostComponents/component_version",
+ "RootServiceHostComponents/properties"
+ ],
+ "Blueprint": [
+ "Blueprints/blueprint_name",
+ "Blueprints/stack_name",
+ "Blueprints/stack_version",
+ "Blueprints/security",
+ "host_groups",
+ "host_groups/components",
+ "host_groups/cardinality",
+ "configurations",
+ "validate_topology",
+ "settings"
+ ],
+ "Recommendation": [
+ "Recommendation/id",
+ "Versions/stack_name",
+ "Versions/stack_version",
+ "recommend",
+ "hosts",
+ "services",
+ "changed_configurations",
+ "user_context",
+ "user_context/operation",
+ "user_context/operation_details",
+ "recommendations",
+ "recommendations/blueprint",
+ "recommendations/blueprint/configurations",
+ "recommendations/blueprint/host_groups",
+ "recommendations/blueprint/host_groups/name",
+ "recommendations/blueprint/host_groups/components",
+ "recommendations/blueprint_cluster_binding",
+ "recommendations/blueprint_cluster_binding/host_groups",
+ "recommendations/blueprint_cluster_binding/host_groups/name",
+ "recommendations/blueprint_cluster_binding/host_groups/hosts",
+ "recommendations/config_groups"
+ ],
+ "Validation": [
+ "Validation/id",
+ "Versions/stack_name",
+ "Versions/stack_version",
+ "items",
+ "items/type",
+ "items/level",
+ "items/message",
+ "items/component-name",
+ "items/host",
+ "items/config-type",
+ "items/config-name",
+ "items/host-group",
+ "validate",
+ "hosts",
+ "services",
+ "recommendations"
+ ],
+ "HostComponentProcess": [
+ "HostComponentProcess/cluster_name",
+ "HostComponentProcess/host_name",
+ "HostComponentProcess/component_name",
+ "HostComponentProcess/name",
+ "HostComponentProcess/status"
+ ],
+ "ClientConfig": [
+ "ServiceComponentInfo/service_name",
+ "ServiceComponentInfo/component_name",
+ "ServiceComponentInfo/cluster_name",
+ "HostRoles/host_name",
+ "_"
+ ],
+ "Widget": [
+ "WidgetInfo/id",
+ "WidgetInfo/cluster_name",
+ "WidgetInfo/widget_name",
+ "WidgetInfo/display_name",
+ "WidgetInfo/widget_type",
+ "WidgetInfo/time_created",
+ "WidgetInfo/author",
+ "WidgetInfo/description",
+ "WidgetInfo/scope",
+ "WidgetInfo/metrics",
+ "WidgetInfo/values",
+ "WidgetInfo/properties",
+ "_"
+ ],
+ "WidgetLayout": [
+ "WidgetLayoutInfo/id",
+ "WidgetLayoutInfo/section_name",
+ "WidgetLayoutInfo/cluster_name",
+ "WidgetLayoutInfo/layout_name",
+ "WidgetLayoutInfo/display_name",
+ "WidgetLayoutInfo/scope",
+ "WidgetLayoutInfo/user_name",
+ "WidgetLayoutInfo/WidgetsInfo",
+ "User/user_name",
+ "_"
+ ],
+ "StackLevelConfiguration": [
+ "StackLevelConfigurations/stack_name",
+ "StackLevelConfigurations/stack_version",
+ "StackLevelConfigurations/property_name",
+ "StackLevelConfigurations/property_value",
+ "StackLevelConfigurations/property_display_name",
+ "StackLevelConfigurations/property_value_attributes",
+ "StackLevelConfigurations/property_depends_on",
+ "StackLevelConfigurations/property_description",
+ "StackLevelConfigurations/type",
+ "StackLevelConfigurations/final",
+ "StackLevelConfigurations/property_type",
+ "_"
+ ],
+ "StackConfigurationDependency": [
+ "StackConfigurationDependency/stack_name",
+ "StackConfigurationDependency/stack_version",
+ "StackConfigurationDependency/service_name",
+ "StackConfigurationDependency/property_name",
+ "StackConfigurationDependency/dependency_type",
+ "StackConfigurationDependency/dependency_name",
+ "_"
+ ],
+ "KerberosDescriptor": [
+ "KerberosDescriptors/kerberos_descriptor_name",
+ "KerberosDescriptors/kerberos_descriptor_text",
+ "_"
+ ],
+ "AmbariConfiguration": [
+ "AmbariConfiguration/id",
+ "AmbariConfiguration/configuration",
+ "AmbariConfiguration/data",
+ "AmbariConfiguration/type",
+ "AmbariConfiguration/version"
+ ]
}
[2/2] ambari git commit: AMBARI-21307 Create new rest resource for
ambari configuration
Posted by lp...@apache.org.
AMBARI-21307 Create new rest resource for ambari configuration
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c954b026
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c954b026
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c954b026
Branch: refs/heads/feature-branch-AMBARI-21307
Commit: c954b026ea0fd066dc544bb325e68be471e21331
Parents: c1eeafb
Author: lpuskas <lp...@apache.org>
Authored: Tue Jun 27 15:03:02 2017 +0200
Committer: lpuskas <lp...@apache.org>
Committed: Tue Jun 27 15:05:34 2017 +0200
----------------------------------------------------------------------
.../AmbariConfigurationResourceDefinition.java | 34 +
.../resources/ResourceInstanceFactoryImpl.java | 3 +
.../AmbariConfigurationRestService.java | 79 ++
.../persistence/PersistenceManagerImpl.java | 40 +-
.../configuration/AmbariConfiguration.java | 25 +
.../configuration/domain/LdapConfiguration.java | 188 ++++
.../service/AmbariConfigurationService.java | 44 +
.../service/ldap/LdapConfigurationService.java | 56 ++
.../server/controller/ControllerModule.java | 40 +-
.../AmbariConfigurationResourceProvider.java | 259 +++++
.../internal/DefaultProviderModule.java | 19 +-
.../ambari/server/controller/spi/Resource.java | 5 +-
.../apache/ambari/server/orm/dao/AlertsDAO.java | 6 +-
.../server/orm/dao/AmbariConfigurationDAO.java | 92 ++
.../orm/entities/AmbariConfigurationEntity.java | 70 ++
.../orm/entities/ConfigurationBaseEntity.java | 159 +++
.../authorization/RoleAuthorization.java | 95 +-
.../resources/Ambari-DDL-Postgres-CREATE.sql | 25 +-
.../src/main/resources/META-INF/persistence.xml | 2 +
.../src/main/resources/key_properties.json | 8 +-
.../src/main/resources/properties.json | 970 ++++++++++---------
21 files changed, 1637 insertions(+), 582 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/api/resources/AmbariConfigurationResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/AmbariConfigurationResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/AmbariConfigurationResourceDefinition.java
new file mode 100644
index 0000000..936a51f
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/AmbariConfigurationResourceDefinition.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.api.resources;
+
+import org.apache.ambari.server.controller.spi.Resource;
+
+public class AmbariConfigurationResourceDefinition extends BaseResourceDefinition {
+
+ public AmbariConfigurationResourceDefinition() {
+ super(Resource.Type.AmbariConfiguration);
+ }
+
+ @Override
+ public String getPluralName() {
+ return "ambariconfigurations";
+ }
+
+ @Override
+ public String getSingularName() {
+ return "ambariconfiguration";
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
index 96e288f..07b3829 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
@@ -471,6 +471,9 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory {
case RemoteCluster:
resourceDefinition = new RemoteClusterResourceDefinition();
break;
+ case AmbariConfiguration:
+ resourceDefinition = new AmbariConfigurationResourceDefinition();
+ break;
default:
throw new IllegalArgumentException("Unsupported resource type: " + type);
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRestService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRestService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRestService.java
new file mode 100644
index 0000000..7d70301
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRestService.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.api.services;
+
+import java.util.Collections;
+
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.ambari.server.controller.spi.Resource;
+
+import io.swagger.annotations.Api;
+
+@Path("/configurations/")
+@Api(value = "/configurations", description = "Endpoint for Ambari configuration related operations")
+public class AmbariConfigurationRestService extends BaseService {
+
+ @POST
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response createAmbariConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri) {
+ return handleRequest(headers, body, uri, Request.Type.POST, createResource(Resource.Type.AmbariConfiguration,
+ Collections.EMPTY_MAP));
+ }
+
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response getAmbariConfigurations(String body, @Context HttpHeaders headers, @Context UriInfo uri) {
+ return handleRequest(headers, body, uri, Request.Type.GET, createResource(Resource.Type.AmbariConfiguration,
+ Collections.EMPTY_MAP));
+ }
+
+ @GET
+ @Path("{configurationId}")
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response getAmbariConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri,
+ @PathParam("configurationId") String configurationId) {
+ return handleRequest(headers, body, uri, Request.Type.GET, createResource(Resource.Type.AmbariConfiguration,
+ Collections.singletonMap(Resource.Type.AmbariConfiguration, configurationId)));
+ }
+
+ @PUT
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response updateAmbariConfiguration() {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @DELETE
+ @Path("{configurationId}")
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response deleteAmbariConfiguration(String body, @Context HttpHeaders headers, @Context UriInfo uri,
+ @PathParam("configurationId") String configurationId) {
+ return handleRequest(headers, body, uri, Request.Type.DELETE, createResource(Resource.Type.AmbariConfiguration,
+ Collections.singletonMap(Resource.Type.AmbariConfiguration, configurationId)));
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/api/services/persistence/PersistenceManagerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/persistence/PersistenceManagerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/persistence/PersistenceManagerImpl.java
index 078dce8..569c0a4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/persistence/PersistenceManagerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/persistence/PersistenceManagerImpl.java
@@ -74,35 +74,37 @@ public class PersistenceManagerImpl implements PersistenceManager {
"to create/store user persisted data.");
}
- if (resource != null) {
+ if (resource == null) {
+ throw new NoSuchParentResourceException("Resource is null");
+ }
- Map<Resource.Type, String> mapResourceIds = resource.getKeyValueMap();
- Resource.Type type = resource.getResourceDefinition().getType();
- Schema schema = m_controller.getSchema(type);
+ Map<Resource.Type, String> resourceMapResourceIds = resource.getKeyValueMap();
+ Resource.Type type = resource.getResourceDefinition().getType();
+ Schema schema = m_controller.getSchema(type);
- Set<NamedPropertySet> setProperties = requestBody.getNamedPropertySets();
- if (setProperties.isEmpty()) {
- requestBody.addPropertySet(new NamedPropertySet("", new HashMap<String, Object>()));
- }
+ Set<NamedPropertySet> requestNamedPropertySets = requestBody.getNamedPropertySets();
- for (NamedPropertySet propertySet : setProperties) {
- for (Map.Entry<Resource.Type, String> entry : mapResourceIds.entrySet()) {
- Map<String, Object> mapProperties = propertySet.getProperties();
- String property = schema.getKeyPropertyId(entry.getKey());
- if (!mapProperties.containsKey(property)) {
- mapProperties.put(property, entry.getValue());
- }
+ if (requestNamedPropertySets.isEmpty()) {
+ requestBody.addPropertySet(new NamedPropertySet("", new HashMap<String, Object>()));
+ }
+
+ for (NamedPropertySet requestNamedPropertySet : requestNamedPropertySets) {
+
+ for (Map.Entry<Resource.Type, String> entry : resourceMapResourceIds.entrySet()) {
+ Map<String, Object> requestMapProperties = requestNamedPropertySet.getProperties();
+ String property = schema.getKeyPropertyId(entry.getKey());
+ if (!requestMapProperties.containsKey(property)) {
+ requestMapProperties.put(property, entry.getValue());
}
}
- return m_controller.createResources(type, createControllerRequest(requestBody));
- } else {
- throw new NoSuchParentResourceException("Resource is null");
}
+ return m_controller.createResources(type, createControllerRequest(requestBody));
+
}
@Override
public RequestStatus update(ResourceInstance resource, RequestBody requestBody)
- throws UnsupportedPropertyException, SystemException, NoSuchParentResourceException, NoSuchResourceException {
+ throws UnsupportedPropertyException, SystemException, NoSuchParentResourceException, NoSuchResourceException {
Map<Resource.Type, String> mapResourceIds = resource.getKeyValueMap();
Resource.Type type = resource.getResourceDefinition().getType();
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/configuration/AmbariConfiguration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/AmbariConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/AmbariConfiguration.java
new file mode 100644
index 0000000..385d1a7
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/AmbariConfiguration.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.configuration;
+
+/**
+ * Marks domain object as ambari configuration objects.
+ * Exposes generic operations (if any) for ambari configuration.
+ *
+ * Configurations marked as AmbariConfiguration are configuration types that are not bound to clusters or stacks.
+ *
+ */
+public interface AmbariConfiguration {
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/configuration/domain/LdapConfiguration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/domain/LdapConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/domain/LdapConfiguration.java
new file mode 100644
index 0000000..92beaad
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/domain/LdapConfiguration.java
@@ -0,0 +1,188 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.configuration.domain;
+
+import org.apache.ambari.server.configuration.AmbariConfiguration;
+
+public class LdapConfiguration implements AmbariConfiguration {
+
+ private String primaryUrl;
+ private String secondaryUrl;
+
+ private boolean anonymousBind;
+ private String managerDn;
+ private String managerPassword;
+ private String baseDN;
+ private String dnAttribute;
+ private String referralMethod;
+
+ //LDAP group properties
+ private String groupBase;
+ private String groupObjectClass;
+ private String groupMembershipAttr;
+ private String groupSearchBase;
+ private String groupSearchFilter;
+
+ //LDAP user properties
+ private String userBase;
+ private String userObjectClass;
+ private String usernameAttribute;
+ private String userSearchBase;
+ private String userSearchFilter;
+
+ public String getPrimaryUrl() {
+ return primaryUrl;
+ }
+
+ public void setPrimaryUrl(String primaryUrl) {
+ this.primaryUrl = primaryUrl;
+ }
+
+ public String getSecondaryUrl() {
+ return secondaryUrl;
+ }
+
+ public void setSecondaryUrl(String secondaryUrl) {
+ this.secondaryUrl = secondaryUrl;
+ }
+
+ public boolean isAnonymousBind() {
+ return anonymousBind;
+ }
+
+ public void setAnonymousBind(boolean anonymousBind) {
+ this.anonymousBind = anonymousBind;
+ }
+
+ public String getManagerDn() {
+ return managerDn;
+ }
+
+ public void setManagerDn(String managerDn) {
+ this.managerDn = managerDn;
+ }
+
+ public String getManagerPassword() {
+ return managerPassword;
+ }
+
+ public void setManagerPassword(String managerPassword) {
+ this.managerPassword = managerPassword;
+ }
+
+ public String getBaseDN() {
+ return baseDN;
+ }
+
+ public void setBaseDN(String baseDN) {
+ this.baseDN = baseDN;
+ }
+
+ public String getDnAttribute() {
+ return dnAttribute;
+ }
+
+ public void setDnAttribute(String dnAttribute) {
+ this.dnAttribute = dnAttribute;
+ }
+
+ public String getReferralMethod() {
+ return referralMethod;
+ }
+
+ public void setReferralMethod(String referralMethod) {
+ this.referralMethod = referralMethod;
+ }
+
+ public String getGroupBase() {
+ return groupBase;
+ }
+
+ public void setGroupBase(String groupBase) {
+ this.groupBase = groupBase;
+ }
+
+ public String getGroupObjectClass() {
+ return groupObjectClass;
+ }
+
+ public void setGroupObjectClass(String groupObjectClass) {
+ this.groupObjectClass = groupObjectClass;
+ }
+
+ public String getGroupMembershipAttr() {
+ return groupMembershipAttr;
+ }
+
+ public void setGroupMembershipAttr(String groupMembershipAttr) {
+ this.groupMembershipAttr = groupMembershipAttr;
+ }
+
+ public String getGroupSearchBase() {
+ return groupSearchBase;
+ }
+
+ public void setGroupSearchBase(String groupSearchBase) {
+ this.groupSearchBase = groupSearchBase;
+ }
+
+ public String getGroupSearchFilter() {
+ return groupSearchFilter;
+ }
+
+ public void setGroupSearchFilter(String groupSearchFilter) {
+ this.groupSearchFilter = groupSearchFilter;
+ }
+
+ public String getUserBase() {
+ return userBase;
+ }
+
+ public void setUserBase(String userBase) {
+ this.userBase = userBase;
+ }
+
+ public String getUserObjectClass() {
+ return userObjectClass;
+ }
+
+ public void setUserObjectClass(String userObjectClass) {
+ this.userObjectClass = userObjectClass;
+ }
+
+ public String getUsernameAttribute() {
+ return usernameAttribute;
+ }
+
+ public void setUsernameAttribute(String usernameAttribute) {
+ this.usernameAttribute = usernameAttribute;
+ }
+
+ public String getUserSearchBase() {
+ return userSearchBase;
+ }
+
+ public void setUserSearchBase(String userSearchBase) {
+ this.userSearchBase = userSearchBase;
+ }
+
+ public String getUserSearchFilter() {
+ return userSearchFilter;
+ }
+
+ public void setUserSearchFilter(String userSearchFilter) {
+ this.userSearchFilter = userSearchFilter;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/configuration/service/AmbariConfigurationService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/service/AmbariConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/service/AmbariConfigurationService.java
new file mode 100644
index 0000000..4d81ebf
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/service/AmbariConfigurationService.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.configuration.service;
+
+import javax.inject.Inject;
+
+import org.apache.ambari.server.configuration.AmbariConfiguration;
+import org.apache.ambari.server.orm.dao.AmbariConfigurationDAO;
+
+/**
+ * Service implementation for handling ambari configuration related logic.
+ * The service operates with entities and "domain" objects: serves its clients with domain objects and implements
+ * transformation logic between ORM entities and domain objects
+ */
+public abstract class AmbariConfigurationService {
+
+ public AmbariConfigurationService() {
+ }
+
+ @Inject
+ private AmbariConfigurationDAO ambariConfigurationDAO;
+
+ protected void persistAmbariConfiguration(AmbariConfiguration ambariConfiguration) {
+ throw new UnsupportedOperationException("Not yet implemented.");
+ }
+
+ public AmbariConfiguration getAmbariConfiguration() {
+ throw new UnsupportedOperationException("Not yet implemented.");
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/configuration/service/ldap/LdapConfigurationService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/service/ldap/LdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/service/ldap/LdapConfigurationService.java
new file mode 100644
index 0000000..86eaceb
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/service/ldap/LdapConfigurationService.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.configuration.service.ldap;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import org.apache.ambari.server.configuration.domain.LdapConfiguration;
+import org.apache.ambari.server.configuration.service.AmbariConfigurationService;
+import org.apache.ambari.server.orm.dao.AmbariConfigurationDAO;
+import org.apache.ambari.server.orm.entities.AmbariConfigurationEntity;
+
+@Singleton
+public class LdapConfigurationService extends AmbariConfigurationService {
+
+ @Inject
+ private AmbariConfigurationDAO ambariConfigurationDAO;
+
+ @Inject
+ public LdapConfigurationService() {
+ }
+
+ public LdapConfiguration getLdapConfiguration() {
+ AmbariConfigurationEntity ambariConfigurationEntity = ambariConfigurationDAO.findByid(1L);
+ return entityTodomain(ambariConfigurationEntity);
+ }
+
+ public void saveLdapConfiguration(LdapConfiguration ldapConfiguration) {
+ // todo do we need this transformation? the incoming json probably can be persisted whitout being transformed into domain
+ ambariConfigurationDAO.persist(domainToEntity(ldapConfiguration));
+ }
+
+ private AmbariConfigurationEntity domainToEntity(LdapConfiguration ldapConfiguration) {
+ AmbariConfigurationEntity ambariConfigurationEntity = new AmbariConfigurationEntity();
+ return ambariConfigurationEntity;
+ }
+
+ private LdapConfiguration entityTodomain(AmbariConfigurationEntity ambariConfigurationEntity) {
+ LdapConfiguration ldapConfiguration = new LdapConfiguration();
+ return ldapConfiguration;
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
index f3c2ec8..a330e09 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
@@ -62,6 +62,7 @@ import org.apache.ambari.server.cleanup.ClasspathScannerUtils;
import org.apache.ambari.server.configuration.Configuration;
import org.apache.ambari.server.configuration.Configuration.ConnectionPoolType;
import org.apache.ambari.server.configuration.Configuration.DatabaseType;
+import org.apache.ambari.server.controller.internal.AmbariConfigurationResourceProvider;
import org.apache.ambari.server.controller.internal.ComponentResourceProvider;
import org.apache.ambari.server.controller.internal.CredentialResourceProvider;
import org.apache.ambari.server.controller.internal.HostComponentResourceProvider;
@@ -450,37 +451,38 @@ public class ControllerModule extends AbstractModule {
*/
private void installFactories() {
install(new FactoryModuleBuilder().implement(
- Cluster.class, ClusterImpl.class).build(ClusterFactory.class));
+ Cluster.class, ClusterImpl.class).build(ClusterFactory.class));
install(new FactoryModuleBuilder().implement(
- Host.class, HostImpl.class).build(HostFactory.class));
+ Host.class, HostImpl.class).build(HostFactory.class));
install(new FactoryModuleBuilder().implement(
- Service.class, ServiceImpl.class).build(ServiceFactory.class));
+ Service.class, ServiceImpl.class).build(ServiceFactory.class));
install(new FactoryModuleBuilder()
- .implement(ResourceProvider.class, Names.named("host"), HostResourceProvider.class)
- .implement(ResourceProvider.class, Names.named("hostComponent"), HostComponentResourceProvider.class)
- .implement(ResourceProvider.class, Names.named("service"), ServiceResourceProvider.class)
- .implement(ResourceProvider.class, Names.named("component"), ComponentResourceProvider.class)
- .implement(ResourceProvider.class, Names.named("member"), MemberResourceProvider.class)
- .implement(ResourceProvider.class, Names.named("repositoryVersion"), RepositoryVersionResourceProvider.class)
- .implement(ResourceProvider.class, Names.named("hostKerberosIdentity"), HostKerberosIdentityResourceProvider.class)
- .implement(ResourceProvider.class, Names.named("credential"), CredentialResourceProvider.class)
- .implement(ResourceProvider.class, Names.named("kerberosDescriptor"), KerberosDescriptorResourceProvider.class)
- .implement(ResourceProvider.class, Names.named("upgrade"), UpgradeResourceProvider.class)
- .build(ResourceProviderFactory.class));
+ .implement(ResourceProvider.class, Names.named("host"), HostResourceProvider.class)
+ .implement(ResourceProvider.class, Names.named("hostComponent"), HostComponentResourceProvider.class)
+ .implement(ResourceProvider.class, Names.named("service"), ServiceResourceProvider.class)
+ .implement(ResourceProvider.class, Names.named("component"), ComponentResourceProvider.class)
+ .implement(ResourceProvider.class, Names.named("member"), MemberResourceProvider.class)
+ .implement(ResourceProvider.class, Names.named("repositoryVersion"), RepositoryVersionResourceProvider.class)
+ .implement(ResourceProvider.class, Names.named("hostKerberosIdentity"), HostKerberosIdentityResourceProvider.class)
+ .implement(ResourceProvider.class, Names.named("credential"), CredentialResourceProvider.class)
+ .implement(ResourceProvider.class, Names.named("kerberosDescriptor"), KerberosDescriptorResourceProvider.class)
+ .implement(ResourceProvider.class, Names.named("upgrade"), UpgradeResourceProvider.class)
+ .implement(ResourceProvider.class, Names.named("ambariConfiguration"), AmbariConfigurationResourceProvider.class)
+ .build(ResourceProviderFactory.class));
install(new FactoryModuleBuilder().implement(
ServiceComponent.class, ServiceComponentImpl.class).build(
ServiceComponentFactory.class));
install(new FactoryModuleBuilder().implement(
- ServiceComponentHost.class, ServiceComponentHostImpl.class).build(
- ServiceComponentHostFactory.class));
+ ServiceComponentHost.class, ServiceComponentHostImpl.class).build(
+ ServiceComponentHostFactory.class));
install(new FactoryModuleBuilder().implement(
- Config.class, ConfigImpl.class).build(ConfigFactory.class));
+ Config.class, ConfigImpl.class).build(ConfigFactory.class));
install(new FactoryModuleBuilder().implement(
- ConfigGroup.class, ConfigGroupImpl.class).build(ConfigGroupFactory.class));
+ ConfigGroup.class, ConfigGroupImpl.class).build(ConfigGroupFactory.class));
install(new FactoryModuleBuilder().implement(RequestExecution.class,
- RequestExecutionImpl.class).build(RequestExecutionFactory.class));
+ RequestExecutionImpl.class).build(RequestExecutionFactory.class));
bind(StageFactory.class).to(StageFactoryImpl.class);
bind(RoleCommandOrderProvider.class).to(CachedRoleCommandOrderProvider.class);
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java
new file mode 100644
index 0000000..babeac9
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java
@@ -0,0 +1,259 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.controller.internal;
+
+import java.io.IOException;
+import java.util.Calendar;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.inject.Inject;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.StaticallyInject;
+import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
+import org.apache.ambari.server.controller.spi.NoSuchResourceException;
+import org.apache.ambari.server.controller.spi.Predicate;
+import org.apache.ambari.server.controller.spi.Request;
+import org.apache.ambari.server.controller.spi.RequestStatus;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
+import org.apache.ambari.server.controller.spi.SystemException;
+import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
+import org.apache.ambari.server.controller.utilities.PredicateHelper;
+import org.apache.ambari.server.controller.utilities.PropertyHelper;
+import org.apache.ambari.server.orm.dao.AmbariConfigurationDAO;
+import org.apache.ambari.server.orm.entities.AmbariConfigurationEntity;
+import org.apache.ambari.server.orm.entities.ConfigurationBaseEntity;
+import org.apache.ambari.server.security.authorization.RoleAuthorization;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Sets;
+
+/**
+ * Resource provider for AmbariConfiguration resources.
+ */
+@StaticallyInject
+public class AmbariConfigurationResourceProvider extends AbstractAuthorizedResourceProvider {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(AmbariConfigurationResourceProvider.class);
+
+ private static final String DEFAULT_VERSION_TAG = "Default version";
+ private static final Integer DEFAULT_VERSION = 1;
+
+
+ /**
+ * Resource property id constants.
+ */
+ private enum ResourcePropertyId {
+
+ ID("AmbariConfiguration/id"),
+ TYPE("AmbariConfiguration/type"),
+ VERSION("AmbariConfiguration/version"),
+ VERSION_TAG("AmbariConfiguration/version_tag"),
+ DATA("AmbariConfiguration/data");
+
+ private String propertyId;
+
+ ResourcePropertyId(String propertyId) {
+ this.propertyId = propertyId;
+ }
+
+ String getPropertyId() {
+ return this.propertyId;
+ }
+
+ public static ResourcePropertyId fromString(String propertyIdStr) {
+ ResourcePropertyId propertyIdFromStr = null;
+
+ for (ResourcePropertyId id : ResourcePropertyId.values()) {
+ if (id.getPropertyId().equals(propertyIdStr)) {
+ propertyIdFromStr = id;
+ break;
+ }
+ }
+
+ if (propertyIdFromStr == null) {
+ throw new IllegalArgumentException("Unsupported property type: " + propertyIdStr);
+ }
+
+ return propertyIdFromStr;
+
+ }
+ }
+
+ @Inject
+ private static AmbariConfigurationDAO ambariConfigurationDAO;
+
+ protected AmbariConfigurationResourceProvider() {
+ super(PropertyHelper.getPropertyIds(Resource.Type.AmbariConfiguration), PropertyHelper.getKeyPropertyIds(Resource.Type.AmbariConfiguration));
+ setRequiredCreateAuthorizations(EnumSet.of(RoleAuthorization.AMBARI_MANAGE_CONFIGURATION));
+ setRequiredDeleteAuthorizations(EnumSet.of(RoleAuthorization.AMBARI_MANAGE_CONFIGURATION));
+
+ }
+
+ @Override
+ protected Set<String> getPKPropertyIds() {
+ return Sets.newHashSet("AmbariConfiguration/id");
+ }
+
+ @Override
+ public RequestStatus createResourcesAuthorized(Request request) throws SystemException, UnsupportedPropertyException,
+ ResourceAlreadyExistsException, NoSuchParentResourceException {
+
+ LOGGER.info("Creating new ambari configuration resource ...");
+ AmbariConfigurationEntity ambariConfigurationEntity = getEntityFromRequest(request);
+
+ LOGGER.info("Persisting new ambari configuration: {} ", ambariConfigurationEntity);
+ ambariConfigurationDAO.persist(ambariConfigurationEntity);
+
+ return getRequestStatus(null);
+ }
+
+
+ @Override
+ protected Set<Resource> getResourcesAuthorized(Request request, Predicate predicate) throws SystemException,
+ UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
+ Set<Resource> resources = Sets.newHashSet();
+
+ List<AmbariConfigurationEntity> ambariConfigurationEntities = ambariConfigurationDAO.findAll();
+ for (AmbariConfigurationEntity ambariConfigurationEntity : ambariConfigurationEntities) {
+ try {
+ resources.add(toResource(ambariConfigurationEntity, getPropertyIds()));
+ } catch (AmbariException e) {
+ LOGGER.error("Error while retrieving ambari configuration", e);
+ }
+ }
+ return resources;
+ }
+
+ @Override
+ protected RequestStatus deleteResourcesAuthorized(Request request, Predicate predicate) throws SystemException,
+ UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
+
+ Long idFromRequest = Long.valueOf((String) PredicateHelper.getProperties(predicate).get(ResourcePropertyId.ID.getPropertyId()));
+
+ if (null == idFromRequest) {
+ LOGGER.debug("No resource id provided in the request");
+ } else {
+ LOGGER.debug("Deleting amari configuration with id: {}", idFromRequest);
+ try {
+ ambariConfigurationDAO.deleteById(idFromRequest);
+ } catch (IllegalStateException e) {
+ throw new NoSuchResourceException(e.getMessage());
+ }
+
+ }
+
+ return getRequestStatus(null);
+
+ }
+
+ private Resource toResource(AmbariConfigurationEntity entity, Set<String> requestedIds) throws AmbariException {
+ Resource resource = new ResourceImpl(Resource.Type.AmbariConfiguration);
+ Set<Map<String, String>> configurationSet = ConfigurationDataConverter.fromJson(entity.getConfigurationBaseEntity().getConfigurationData());
+
+ setResourceProperty(resource, ResourcePropertyId.ID.getPropertyId(), entity.getId(), requestedIds);
+ setResourceProperty(resource, ResourcePropertyId.TYPE.getPropertyId(), entity.getConfigurationBaseEntity().getType(), requestedIds);
+ setResourceProperty(resource, ResourcePropertyId.DATA.getPropertyId(), configurationSet, requestedIds);
+
+ return resource;
+ }
+
+ private AmbariConfigurationEntity getEntityFromRequest(Request request) {
+
+ AmbariConfigurationEntity ambariConfigurationEntity = new AmbariConfigurationEntity();
+ ambariConfigurationEntity.setConfigurationBaseEntity(new ConfigurationBaseEntity());
+
+
+ for (ResourcePropertyId resourcePropertyId : ResourcePropertyId.values()) {
+ Object requestValue = getValueFromRequest(resourcePropertyId, request);
+
+ switch (resourcePropertyId) {
+ case DATA:
+ if (requestValue == null) {
+ throw new IllegalArgumentException("No configuration data is provided in the request");
+ }
+
+ ambariConfigurationEntity.getConfigurationBaseEntity().setConfigurationData(ConfigurationDataConverter.toJson(requestValue));
+ break;
+ case TYPE:
+ ambariConfigurationEntity.getConfigurationBaseEntity().setType((String) requestValue);
+ break;
+
+ case VERSION:
+ Integer version = (requestValue == null) ? DEFAULT_VERSION : Integer.valueOf((Integer) requestValue);
+ ambariConfigurationEntity.getConfigurationBaseEntity().setVersion((version));
+ break;
+ case VERSION_TAG:
+ String versionTag = requestValue == null ? DEFAULT_VERSION_TAG : (String) requestValue;
+ ambariConfigurationEntity.getConfigurationBaseEntity().setVersionTag(versionTag);
+ break;
+ default:
+ LOGGER.debug("Ignored property in the request: {}", resourcePropertyId);
+ break;
+ }
+ }
+ ambariConfigurationEntity.getConfigurationBaseEntity().setCreateTimestamp(Calendar.getInstance().getTimeInMillis());
+ return ambariConfigurationEntity;
+
+ }
+
+ private Object getValueFromRequest(ResourcePropertyId resourcePropertyIdEnum, Request request) {
+ LOGGER.debug("Locating resource property [{}] in the request ...", resourcePropertyIdEnum);
+ Object requestValue = null;
+ for (Map<String, Object> propertyMap : request.getProperties()) {
+ if (propertyMap.containsKey(resourcePropertyIdEnum.getPropertyId())) {
+ requestValue = propertyMap.get(resourcePropertyIdEnum.getPropertyId());
+ LOGGER.debug("Found resource property {} in the request, value: {} ...", resourcePropertyIdEnum, requestValue);
+ break;
+ }
+ }
+ return requestValue;
+ }
+
+ private static final class ConfigurationDataConverter {
+ private static final ObjectMapper objectMapper = new ObjectMapper();
+
+ public static String toJson(Object configData) {
+ String json = null;
+ try {
+ json = objectMapper.writeValueAsString(configData);
+ } catch (IOException e) {
+ LOGGER.error("Could not transform configuration data to json: {}", configData);
+ throw new IllegalArgumentException("Could not transform configuration data to json");
+ }
+ return json;
+ }
+
+ public static Set fromJson(String configAsJson) {
+ Set configSet = Sets.newHashSet();
+ try {
+ configSet = objectMapper.readValue(configAsJson, configSet.getClass());
+ } catch (IOException e) {
+ LOGGER.error("Could not transform configuration data from json: {}", configAsJson);
+ throw new IllegalArgumentException("Could not transform configuration data from json");
+ }
+
+ return configSet;
+ }
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java
index 074f8e1..9d68d05 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java
@@ -26,14 +26,15 @@ import org.apache.ambari.server.controller.AmbariServer;
import org.apache.ambari.server.controller.spi.Resource;
import org.apache.ambari.server.controller.spi.ResourceProvider;
import org.apache.ambari.server.controller.utilities.PropertyHelper;
-
-import com.google.inject.Inject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* The default provider module implementation.
*/
public class DefaultProviderModule extends AbstractProviderModule {
- @Inject
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(DefaultProviderModule.class);
private AmbariManagementController managementController;
// ----- Constructors ------------------------------------------------------
@@ -52,8 +53,10 @@ public class DefaultProviderModule extends AbstractProviderModule {
@Override
protected ResourceProvider createResourceProvider(Resource.Type type) {
- Set<String> propertyIds = PropertyHelper.getPropertyIds(type);
- Map<Resource.Type,String> keyPropertyIds = PropertyHelper.getKeyPropertyIds(type);
+
+ LOGGER.debug("Creating resource provider for the type: {}", type);
+ Set<String> propertyIds = PropertyHelper.getPropertyIds(type);
+ Map<Resource.Type, String> keyPropertyIds = PropertyHelper.getKeyPropertyIds(type);
switch (type.getInternalType()) {
case Workflow:
@@ -124,10 +127,12 @@ public class DefaultProviderModule extends AbstractProviderModule {
return new ArtifactResourceProvider(managementController);
case RemoteCluster:
return new RemoteClusterResourceProvider();
-
+ case AmbariConfiguration:
+ return new AmbariConfigurationResourceProvider();
default:
+ LOGGER.debug("Delegating creation of resource provider for: {} to the AbstractControllerResourceProvider", type.getInternalType());
return AbstractControllerResourceProvider.getResourceProvider(type, propertyIds,
- keyPropertyIds, managementController);
+ keyPropertyIds, managementController);
}
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
index 362b4e6..7835373 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
@@ -160,7 +160,8 @@ public interface Resource {
VersionDefinition,
ClusterKerberosDescriptor,
LoggingQuery,
- RemoteCluster;
+ RemoteCluster,
+ AmbariConfiguration;
/**
* Get the {@link Type} that corresponds to this InternalType.
@@ -282,6 +283,8 @@ public interface Resource {
public static final Type ClusterKerberosDescriptor = InternalType.ClusterKerberosDescriptor.getType();
public static final Type LoggingQuery = InternalType.LoggingQuery.getType();
public static final Type RemoteCluster = InternalType.RemoteCluster.getType();
+ public static final Type AmbariConfiguration = InternalType.AmbariConfiguration.getType();
+
/**
* The type name.
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java
index dceafcb..ed1f5e8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java
@@ -220,11 +220,11 @@ public class AlertsDAO implements Cleanable {
* @return all alerts or an empty list if none exist (never {@code null}).
*/
@RequiresSession
- public List<AlertHistoryEntity> findAll() {
- TypedQuery<AlertHistoryEntity> query = m_entityManagerProvider.get().createNamedQuery(
- "AlertHistoryEntity.findAll", AlertHistoryEntity.class);
+ public List<AlertHistoryEntity> findAll() {TypedQuery<AlertHistoryEntity> query = m_entityManagerProvider.get().createNamedQuery(
+ "AlertHistoryEntity.findAll", AlertHistoryEntity.class);
return m_daoUtils.selectList(query);
+
}
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAO.java
new file mode 100644
index 0000000..dea37eb
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAO.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.orm.dao;
+
+import java.util.List;
+
+import javax.inject.Inject;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+
+import org.apache.ambari.server.orm.RequiresSession;
+import org.apache.ambari.server.orm.entities.AmbariConfigurationEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.inject.persist.Transactional;
+
+/**
+ * DAO dealing with ambari configuration related JPA operations.
+ */
+
+@Singleton
+// todo extend CrudDao (amend crud dao to handle NPEs)
+public class AmbariConfigurationDAO {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(AmbariConfigurationDAO.class);
+
+ @Inject
+ private Provider<EntityManager> entityManagerProvider;
+
+ /**
+ * DAO utilities for dealing mostly with {@link TypedQuery} results.
+ */
+ @Inject
+ private DaoUtils daoUtils;
+
+ public AmbariConfigurationEntity findByid(Long id) {
+ return entityManagerProvider.get().find(AmbariConfigurationEntity.class, id);
+ }
+
+ @RequiresSession
+ @Transactional
+ public void persist(AmbariConfigurationEntity entity) {
+ LOGGER.debug("Persisting ambari configuration: {}", entity);
+ entityManagerProvider.get().persist(entity);
+ }
+
+ @RequiresSession
+ public List<AmbariConfigurationEntity> findAll() {
+ TypedQuery<AmbariConfigurationEntity> query = entityManagerProvider.get().createNamedQuery(
+ "AmbariConfigurationEntity.findAll", AmbariConfigurationEntity.class);
+ return daoUtils.selectList(query);
+ }
+
+
+ @RequiresSession
+ @Transactional
+ public void deleteById(Long ambariConfigurationId) {
+
+ if (ambariConfigurationId == null) {
+ throw new IllegalArgumentException("No Ambari Configuration id provided.");
+ }
+
+ LOGGER.debug("Removing Ambari Configuration with id :{}", ambariConfigurationId);
+
+ AmbariConfigurationEntity ambariConfigurationEntity = findByid(ambariConfigurationId);
+ if (ambariConfigurationEntity == null) {
+ String msg = String.format("No Ambari Configuration found with id: %s", ambariConfigurationId);
+ LOGGER.debug(msg);
+ throw new IllegalStateException(msg);
+ }
+
+ entityManagerProvider.get().remove(ambariConfigurationEntity);
+ LOGGER.debug("Ambari Configuration with id: {}", ambariConfigurationId);
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntity.java
new file mode 100644
index 0000000..34fa221
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AmbariConfigurationEntity.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.orm.entities;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.MapsId;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "ambari_configuration")
+@NamedQueries({
+ @NamedQuery(
+ name = "AmbariConfigurationEntity.findAll",
+ query = "select ace from AmbariConfigurationEntity ace")
+})
+
+public class AmbariConfigurationEntity {
+
+ @Id
+ @Column(name = "id")
+ private Long id;
+
+ @OneToOne(cascade = CascadeType.ALL)
+ @MapsId
+ @JoinColumn(name = "id")
+ private ConfigurationBaseEntity configurationBaseEntity;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public ConfigurationBaseEntity getConfigurationBaseEntity() {
+ return configurationBaseEntity;
+ }
+
+ public void setConfigurationBaseEntity(ConfigurationBaseEntity configurationBaseEntity) {
+ this.configurationBaseEntity = configurationBaseEntity;
+ }
+
+ @Override
+ public String toString() {
+ return "AmbariConfigurationEntity{" +
+ "id=" + id +
+ ", configurationBaseEntity=" + configurationBaseEntity +
+ '}';
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigurationBaseEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigurationBaseEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigurationBaseEntity.java
new file mode 100644
index 0000000..9ad30d7
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigurationBaseEntity.java
@@ -0,0 +1,159 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.orm.entities;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+@Table(name = "configuration_base")
+@TableGenerator(
+ name = "configuration_id_generator",
+ table = "ambari_sequences",
+ pkColumnName = "sequence_name",
+ valueColumnName = "sequence_value",
+ pkColumnValue = "configuration_id_seq",
+ initialValue = 1
+)
+@Entity
+public class ConfigurationBaseEntity {
+
+ @Id
+ @Column(name = "id")
+ @GeneratedValue(strategy = GenerationType.TABLE, generator = "configuration_id_generator")
+ private Long id;
+
+ @Column(name = "version")
+ private Integer version;
+
+ @Column(name = "version_tag")
+ private String versionTag;
+
+ @Column(name = "type")
+ private String type;
+
+ @Column(name = "data")
+ private String configurationData;
+
+ @Column(name = "attributes")
+ private String configurationAttributes;
+
+ @Column(name = "create_timestamp")
+ private Long createTimestamp;
+
+ public Long getId() {
+ return id;
+ }
+
+ public Integer getVersion() {
+ return version;
+ }
+
+ public void setVersion(Integer version) {
+ this.version = version;
+ }
+
+ public String getVersionTag() {
+ return versionTag;
+ }
+
+ public void setVersionTag(String versionTag) {
+ this.versionTag = versionTag;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getConfigurationData() {
+ return configurationData;
+ }
+
+ public void setConfigurationData(String configurationData) {
+ this.configurationData = configurationData;
+ }
+
+ public String getConfigurationAttributes() {
+ return configurationAttributes;
+ }
+
+ public void setConfigurationAttributes(String configurationAttributes) {
+ this.configurationAttributes = configurationAttributes;
+ }
+
+ public Long getCreateTimestamp() {
+ return createTimestamp;
+ }
+
+ public void setCreateTimestamp(Long createTimestamp) {
+ this.createTimestamp = createTimestamp;
+ }
+
+ @Override
+ public String toString() {
+ return "ConfigurationBaseEntity{" +
+ "id=" + id +
+ ", version=" + version +
+ ", versionTag='" + versionTag + '\'' +
+ ", type='" + type + '\'' +
+ ", configurationData='" + configurationData + '\'' +
+ ", configurationAttributes='" + configurationAttributes + '\'' +
+ ", createTimestamp=" + createTimestamp +
+ '}';
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ConfigurationBaseEntity that = (ConfigurationBaseEntity) o;
+
+ return new EqualsBuilder()
+ .append(id, that.id)
+ .append(version, that.version)
+ .append(versionTag, that.versionTag)
+ .append(type, that.type)
+ .append(configurationData, that.configurationData)
+ .append(configurationAttributes, that.configurationAttributes)
+ .append(createTimestamp, that.createTimestamp)
+ .isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder(17, 37)
+ .append(id)
+ .append(version)
+ .append(versionTag)
+ .append(type)
+ .append(configurationData)
+ .append(configurationAttributes)
+ .append(createTimestamp)
+ .toHashCode();
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/RoleAuthorization.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/RoleAuthorization.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/RoleAuthorization.java
index cd35c2c..3c50628 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/RoleAuthorization.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/RoleAuthorization.java
@@ -39,6 +39,7 @@ public enum RoleAuthorization {
AMBARI_MANAGE_VIEWS("AMBARI.MANAGE_VIEWS"),
AMBARI_RENAME_CLUSTER("AMBARI.RENAME_CLUSTER"),
AMBARI_RUN_CUSTOM_COMMAND("AMBARI.RUN_CUSTOM_COMMAND"),
+ AMBARI_MANAGE_CONFIGURATION("AMBARI.MANAGE_CONFIGURATION"),
CLUSTER_MANAGE_CREDENTIALS("CLUSTER.MANAGE_CREDENTIALS"),
CLUSTER_MODIFY_CONFIGS("CLUSTER.MODIFY_CONFIGS"),
CLUSTER_MANAGE_CONFIG_GROUPS("CLUSTER.MANAGE_CONFIG_GROUPS"),
@@ -84,58 +85,58 @@ public enum RoleAuthorization {
VIEW_USE("VIEW.USE");
public static final Set<RoleAuthorization> AUTHORIZATIONS_VIEW_CLUSTER = EnumSet.of(
- CLUSTER_VIEW_STATUS_INFO,
- CLUSTER_VIEW_ALERTS,
- CLUSTER_VIEW_CONFIGS,
- CLUSTER_VIEW_METRICS,
- CLUSTER_VIEW_STACK_DETAILS,
- CLUSTER_MODIFY_CONFIGS,
- CLUSTER_MANAGE_CONFIG_GROUPS,
- CLUSTER_TOGGLE_ALERTS,
- CLUSTER_TOGGLE_KERBEROS,
- CLUSTER_UPGRADE_DOWNGRADE_STACK);
+ CLUSTER_VIEW_STATUS_INFO,
+ CLUSTER_VIEW_ALERTS,
+ CLUSTER_VIEW_CONFIGS,
+ CLUSTER_VIEW_METRICS,
+ CLUSTER_VIEW_STACK_DETAILS,
+ CLUSTER_MODIFY_CONFIGS,
+ CLUSTER_MANAGE_CONFIG_GROUPS,
+ CLUSTER_TOGGLE_ALERTS,
+ CLUSTER_TOGGLE_KERBEROS,
+ CLUSTER_UPGRADE_DOWNGRADE_STACK);
public static final Set<RoleAuthorization> AUTHORIZATIONS_UPDATE_CLUSTER = EnumSet.of(
- CLUSTER_TOGGLE_ALERTS,
- CLUSTER_TOGGLE_KERBEROS,
- CLUSTER_UPGRADE_DOWNGRADE_STACK,
- CLUSTER_MODIFY_CONFIGS,
- CLUSTER_MANAGE_AUTO_START,
- SERVICE_MODIFY_CONFIGS);
+ CLUSTER_TOGGLE_ALERTS,
+ CLUSTER_TOGGLE_KERBEROS,
+ CLUSTER_UPGRADE_DOWNGRADE_STACK,
+ CLUSTER_MODIFY_CONFIGS,
+ CLUSTER_MANAGE_AUTO_START,
+ SERVICE_MODIFY_CONFIGS);
public static final Set<RoleAuthorization> AUTHORIZATIONS_VIEW_SERVICE = EnumSet.of(
- SERVICE_VIEW_ALERTS,
- SERVICE_VIEW_CONFIGS,
- SERVICE_VIEW_METRICS,
- SERVICE_VIEW_STATUS_INFO,
- SERVICE_COMPARE_CONFIGS,
- SERVICE_ADD_DELETE_SERVICES,
- SERVICE_DECOMMISSION_RECOMMISSION,
- SERVICE_ENABLE_HA,
- SERVICE_MANAGE_CONFIG_GROUPS,
- SERVICE_MODIFY_CONFIGS,
- SERVICE_START_STOP,
- SERVICE_TOGGLE_MAINTENANCE,
- SERVICE_TOGGLE_ALERTS,
- SERVICE_MOVE,
- SERVICE_RUN_CUSTOM_COMMAND,
- SERVICE_RUN_SERVICE_CHECK);
+ SERVICE_VIEW_ALERTS,
+ SERVICE_VIEW_CONFIGS,
+ SERVICE_VIEW_METRICS,
+ SERVICE_VIEW_STATUS_INFO,
+ SERVICE_COMPARE_CONFIGS,
+ SERVICE_ADD_DELETE_SERVICES,
+ SERVICE_DECOMMISSION_RECOMMISSION,
+ SERVICE_ENABLE_HA,
+ SERVICE_MANAGE_CONFIG_GROUPS,
+ SERVICE_MODIFY_CONFIGS,
+ SERVICE_START_STOP,
+ SERVICE_TOGGLE_MAINTENANCE,
+ SERVICE_TOGGLE_ALERTS,
+ SERVICE_MOVE,
+ SERVICE_RUN_CUSTOM_COMMAND,
+ SERVICE_RUN_SERVICE_CHECK);
public static final Set<RoleAuthorization> AUTHORIZATIONS_UPDATE_SERVICE = EnumSet.of(
- SERVICE_ADD_DELETE_SERVICES,
- SERVICE_DECOMMISSION_RECOMMISSION,
- SERVICE_ENABLE_HA,
- SERVICE_MANAGE_CONFIG_GROUPS,
- SERVICE_MODIFY_CONFIGS,
- SERVICE_START_STOP,
- SERVICE_TOGGLE_MAINTENANCE,
- SERVICE_TOGGLE_ALERTS,
- SERVICE_MOVE,
- SERVICE_RUN_CUSTOM_COMMAND,
- SERVICE_RUN_SERVICE_CHECK,
- SERVICE_MANAGE_ALERTS,
- SERVICE_MANAGE_AUTO_START,
- SERVICE_SET_SERVICE_USERS_GROUPS);
+ SERVICE_ADD_DELETE_SERVICES,
+ SERVICE_DECOMMISSION_RECOMMISSION,
+ SERVICE_ENABLE_HA,
+ SERVICE_MANAGE_CONFIG_GROUPS,
+ SERVICE_MODIFY_CONFIGS,
+ SERVICE_START_STOP,
+ SERVICE_TOGGLE_MAINTENANCE,
+ SERVICE_TOGGLE_ALERTS,
+ SERVICE_MOVE,
+ SERVICE_RUN_CUSTOM_COMMAND,
+ SERVICE_RUN_SERVICE_CHECK,
+ SERVICE_MANAGE_ALERTS,
+ SERVICE_MANAGE_AUTO_START,
+ SERVICE_SET_SERVICE_USERS_GROUPS);
private final String id;
@@ -162,7 +163,7 @@ public enum RoleAuthorization {
/**
* Safely translates a role authorization Id to a RoleAuthorization
*
- * @param authenticationId an authentication id
+ * @param authenticationId an authentication id
* @return a RoleAuthorization or null if no translation can be made
*/
public static RoleAuthorization translate(String authenticationId) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index 5899179..dffff86 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -62,8 +62,26 @@ CREATE TABLE clusters (
desired_cluster_state VARCHAR(255) NOT NULL,
desired_stack_id BIGINT NOT NULL,
CONSTRAINT PK_clusters PRIMARY KEY (cluster_id),
- CONSTRAINT FK_clusters_desired_stack_id FOREIGN KEY (desired_stack_id) REFERENCES stack(stack_id),
- CONSTRAINT FK_clusters_resource_id FOREIGN KEY (resource_id) REFERENCES adminresource(resource_id));
+ CONSTRAINT FK_clusters_desired_stack_id FOREIGN KEY (desired_stack_id) REFERENCES stack (stack_id),
+ CONSTRAINT FK_clusters_resource_id FOREIGN KEY (resource_id) REFERENCES adminresource (resource_id)
+);
+
+CREATE TABLE configuration_base (
+ id BIGINT NOT NULL,
+ version_tag VARCHAR(255) NOT NULL,
+ version BIGINT NOT NULL,
+ type VARCHAR(255) NOT NULL,
+ data TEXT NOT NULL,
+ attributes TEXT,
+ create_timestamp BIGINT NOT NULL,
+ CONSTRAINT PK_configuration_base PRIMARY KEY (id)
+);
+
+CREATE TABLE ambari_configuration (
+ id BIGINT NOT NULL,
+ CONSTRAINT PK_ambari_configuration PRIMARY KEY (id),
+ CONSTRAINT FK_ambari_configuration_configuration_base FOREIGN KEY (id) REFERENCES configuration_base (id)
+);
CREATE TABLE clusterconfig (
config_id BIGINT NOT NULL,
@@ -1089,6 +1107,7 @@ INSERT INTO ambari_sequences (sequence_name, sequence_value) VALUES
('remote_cluster_id_seq', 0),
('remote_cluster_service_id_seq', 0),
('servicecomponent_version_id_seq', 0),
+ ('configuration_id_seq', 0),
('hostcomponentdesiredstate_id_seq', 0);
INSERT INTO adminresourcetype (resource_type_id, resource_type_name) VALUES
@@ -1173,6 +1192,7 @@ INSERT INTO roleauthorization(authorization_id, authorization_name)
SELECT 'AMBARI.ADD_DELETE_CLUSTERS', 'Create new clusters' UNION ALL
SELECT 'AMBARI.RENAME_CLUSTER', 'Rename clusters' UNION ALL
SELECT 'AMBARI.MANAGE_SETTINGS', 'Manage administrative settings' UNION ALL
+ SELECT 'AMBARI.MANAGE_CONFIGURATION', 'Manage ambari configuration' UNION ALL
SELECT 'AMBARI.MANAGE_USERS', 'Manage users' UNION ALL
SELECT 'AMBARI.MANAGE_GROUPS', 'Manage groups' UNION ALL
SELECT 'AMBARI.MANAGE_VIEWS', 'Manage Ambari Views' UNION ALL
@@ -1378,6 +1398,7 @@ INSERT INTO permission_roleauthorization(permission_id, authorization_id)
SELECT permission_id, 'AMBARI.ADD_DELETE_CLUSTERS' FROM adminpermission WHERE permission_name='AMBARI.ADMINISTRATOR' UNION ALL
SELECT permission_id, 'AMBARI.RENAME_CLUSTER' FROM adminpermission WHERE permission_name='AMBARI.ADMINISTRATOR' UNION ALL
SELECT permission_id, 'AMBARI.MANAGE_SETTINGS' FROM adminpermission WHERE permission_name='AMBARI.ADMINISTRATOR' UNION ALL
+ SELECT permission_id, 'AMBARI.MANAGE_CONFIGURATION' FROM adminpermission WHERE permission_name='AMBARI.ADMINISTRATOR' UNION ALL
SELECT permission_id, 'AMBARI.MANAGE_USERS' FROM adminpermission WHERE permission_name='AMBARI.ADMINISTRATOR' UNION ALL
SELECT permission_id, 'AMBARI.MANAGE_GROUPS' FROM adminpermission WHERE permission_name='AMBARI.ADMINISTRATOR' UNION ALL
SELECT permission_id, 'AMBARI.MANAGE_VIEWS' FROM adminpermission WHERE permission_name='AMBARI.ADMINISTRATOR' UNION ALL
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/META-INF/persistence.xml b/ambari-server/src/main/resources/META-INF/persistence.xml
index e4045ef..0f8e964 100644
--- a/ambari-server/src/main/resources/META-INF/persistence.xml
+++ b/ambari-server/src/main/resources/META-INF/persistence.xml
@@ -96,6 +96,8 @@
<class>org.apache.ambari.server.orm.entities.KerberosDescriptorEntity</class>
<class>org.apache.ambari.server.orm.entities.RemoteAmbariClusterEntity</class>
<class>org.apache.ambari.server.orm.entities.RemoteAmbariClusterServiceEntity</class>
+ <class>org.apache.ambari.server.orm.entities.ConfigurationBaseEntity</class>
+ <class>org.apache.ambari.server.orm.entities.AmbariConfigurationEntity</class>
<properties>
<property name="eclipselink.cache.size.default" value="10000" />
http://git-wip-us.apache.org/repos/asf/ambari/blob/c954b026/ambari-server/src/main/resources/key_properties.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/key_properties.json b/ambari-server/src/main/resources/key_properties.json
index 5d76062..e2edc3a 100644
--- a/ambari-server/src/main/resources/key_properties.json
+++ b/ambari-server/src/main/resources/key_properties.json
@@ -150,12 +150,16 @@
"StackLevelConfiguration": {
"Stack": "StackLevelConfigurations/stack_name",
"StackVersion": "StackLevelConfigurations/stack_version",
- "StackLevelConfiguration": "StackLevelConfigurations/property_name"
+ "StackLevelConfiguration": "StackLevelConfigurations/property_name"
},
"KerberosDescriptor": {
"KerberosDescriptor": "KerberosDescriptors/kerberos_descriptor_name"
},
"LoggingQuery": {
- "Cluster" : "logging/cluster_name"
+ "Cluster": "logging/cluster_name"
+ },
+ "AmbariConfiguration": {
+ "AmbariConfiguration": "AmbariConfiguration/id",
+ "Configuration": "AmbariConfiguration/configuration/id"
}
}