/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v57</h1>       <p>Introduced in Cloudera Manager 7.13.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.13.1
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package com.cloudera.api.swagger;

import com.cloudera.api.swagger.model.ApiCommand;
import com.cloudera.api.swagger.model.ApiCommandList;
import com.cloudera.api.swagger.model.ApiCommandMetadataList;
import com.cloudera.api.swagger.model.ApiConfigList;
import com.cloudera.api.swagger.model.ApiEntityTag;
import com.cloudera.api.swagger.model.ApiImpalaRoleDiagnosticsArgs;
import com.cloudera.api.swagger.model.ApiMetricList;
import com.cloudera.api.swagger.model.ApiRole;
import com.cloudera.api.swagger.model.ApiRoleConfigList;
import com.cloudera.api.swagger.model.ApiRoleList;
import com.cloudera.api.swagger.model.ApiRoleNameList;
import java.io.File;
import org.junit.Test;
import org.junit.Ignore;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * API tests for RolesResourceApi
 */
@Ignore
public class RolesResourceApiTest {

    private final RolesResourceApi api = new RolesResourceApi();

    /**
     * Attach tags to the role.
     *
     * Attach tags to the role. Tag names beginning with the prefix _cldr_ (case insensitive) are reserved for internal use by Cloudera.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void addTagsTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        List<ApiEntityTag> body = null;
        List<ApiEntityTag> response = api.addTags(clusterName, roleName, serviceName, body);

        // TODO: test validations
    }
    /**
     * Bulk delete roles in a particular service by name.
     *
     * Bulk delete roles in a particular service by name. Fails if any role cannot be found.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void bulkDeleteRolesTest() throws Exception {
        String clusterName = null;
        String serviceName = null;
        ApiRoleNameList body = null;
        ApiRoleList response = api.bulkDeleteRoles(clusterName, serviceName, body);

        // TODO: test validations
    }
    /**
     * Create new roles in a given service.
     *
     * Create new roles in a given service.  &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Service Type&lt;/th&gt; &lt;th&gt;Available Role Types&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;HDFS (CDH3)&lt;/td&gt; &lt;td&gt;NAMENODE, DATANODE, SECONDARYNAMENODE, BALANCER, GATEWAY&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;HDFS (CDH4)&lt;/td&gt; &lt;td&gt;NAMENODE, DATANODE, SECONDARYNAMENODE, BALANCER, HTTPFS, FAILOVERCONTROLLER, GATEWAY, JOURNALNODE&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;HDFS (CDH5)&lt;/td&gt; &lt;td&gt;NAMENODE, DATANODE, SECONDARYNAMENODE, BALANCER, HTTPFS, FAILOVERCONTROLLER, GATEWAY, JOURNALNODE, NFSGATEWAY&lt;/td&gt; &lt;/tr&gt; &lt;td&gt;MAPREDUCE&lt;/td&gt; &lt;td&gt;JOBTRACKER, TASKTRACKER, GATEWAY, FAILOVERCONTROLLER,&lt;/td&gt; &lt;/tr&gt; &lt;td&gt;HBASE&lt;/td&gt; &lt;td&gt;MASTER, REGIONSERVER, GATEWAY, HBASETHRIFTSERVER, HBASERESTSERVER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;YARN&lt;/td&gt; &lt;td&gt;RESOURCEMANAGER, NODEMANAGER, JOBHISTORY, GATEWAY&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;OOZIE&lt;/td&gt; &lt;td&gt;OOZIE_SERVER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;ZOOKEEPER&lt;/td&gt; &lt;td&gt;SERVER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;HUE (CDH3)&lt;/td&gt; &lt;td&gt;HUE_SERVER, BEESWAX_SERVER, KT_RENEWER, JOBSUBD&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;HUE (CDH4)&lt;/td&gt; &lt;td&gt;HUE_SERVER, BEESWAX_SERVER, KT_RENEWER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;HUE (CDH5)&lt;/td&gt; &lt;td&gt;HUE_SERVER, KT_RENEWER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;HUE (CDH5 5.5+)&lt;/td&gt; &lt;td&gt;HUE_SERVER, KT_RENEWER, HUE_LOAD_BALANCER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;FLUME&lt;/td&gt; &lt;td&gt;AGENT&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;IMPALA (CDH4)&lt;/td&gt; &lt;td&gt;IMPALAD, STATESTORE, CATALOGSERVER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;IMPALA (CDH5)&lt;/td&gt; &lt;td&gt;IMPALAD, STATESTORE, CATALOGSERVER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;HIVE&lt;/td&gt; &lt;td&gt;HIVESERVER2, HIVEMETASTORE, WEBHCAT, GATEWAY&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;SOLR&lt;/td&gt; &lt;td&gt;SOLR_SERVER, GATEWAY&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;SQOOP&lt;/td&gt; &lt;td&gt;SQOOP_SERVER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;SQOOP_CLIENT&lt;/td&gt; &lt;td&gt;GATEWAY&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;SENTRY&lt;/td&gt; &lt;td&gt;SENTRY_SERVER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;ACCUMULO16&lt;/td&gt; &lt;td&gt;GARBAGE_COLLECTOR, GATEWAY, ACCUMULO16_MASTER, MONITOR, ACCUMULO16_TSERVER, TRACER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;KMS&lt;/td&gt; &lt;td&gt;KMS&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;KS_INDEXER&lt;/td&gt; &lt;td&gt;HBASE_INDEXER&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;SPARK_ON_YARN&lt;/td&gt; &lt;td&gt;GATEWAY, SPARK_YARN_HISTORY_SERVER&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;  &lt;/table&gt;  When specifying roles to be created, the names provided for each role must not conflict with the names that CM auto-generates for roles. Specifically, names of the form \&quot;&lt;service name&gt;-&lt;role type&gt;-&lt;arbitrary value&gt;\&quot; cannot be used unless the &lt;arbitrary value&gt; is the same one CM would use. If CM detects such a conflict, the error message will indicate what &lt;arbitrary value&gt; is safe to use. Alternately, a differently formatted name should be used.  Since API v6: The role name can be left blank to allow CM to generate the name.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void createRolesTest() throws Exception {
        String clusterName = null;
        String serviceName = null;
        ApiRoleList body = null;
        ApiRoleList response = api.createRoles(clusterName, serviceName, body);

        // TODO: test validations
    }
    /**
     * Force deletes a role from a given service.
     *
     * Force deletes a role from a given service.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void deleteForceRoleTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        ApiRole response = api.deleteForceRole(clusterName, roleName, serviceName);

        // TODO: test validations
    }
    /**
     * Deletes a role from a given service.
     *
     * Deletes a role from a given service.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void deleteRoleTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        ApiRole response = api.deleteRole(clusterName, roleName, serviceName);

        // TODO: test validations
    }
    /**
     * Remove the tags associated with the role.
     *
     * Remove the tags associated with the role. Tag names beginning with the prefix _cldr_ (case insensitive) are reserved for internal use by Cloudera.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void deleteTagsTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        List<ApiEntityTag> body = null;
        List<ApiEntityTag> response = api.deleteTags(clusterName, roleName, serviceName, body);

        // TODO: test validations
    }
    /**
     * Put the role into maintenance mode.
     *
     * Put the role into maintenance mode. This is a synchronous command. The result is known immediately upon return.  &lt;p&gt; Available since API v2. &lt;/p&gt;
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void enterMaintenanceModeTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        ApiCommand response = api.enterMaintenanceMode(clusterName, roleName, serviceName);

        // TODO: test validations
    }
    /**
     * Take the role out of maintenance mode.
     *
     * Take the role out of maintenance mode. This is a synchronous command. The result is known immediately upon return.  &lt;p&gt; Available since API v2. &lt;/p&gt;
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void exitMaintenanceModeTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        ApiCommand response = api.exitMaintenanceMode(clusterName, roleName, serviceName);

        // TODO: test validations
    }
    /**
     * Retrieves the log file for the role&#x27;s main process.
     *
     * Retrieves the log file for the role&#x27;s main process. &lt;p&gt; If the role is not started, this will be the log file associated with the last time the role was run. &lt;p&gt; Log files are returned as plain text (type \&quot;text/plain\&quot;).
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void getFullLogTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        String response = api.getFullLog(clusterName, roleName, serviceName);

        // TODO: test validations
    }
    /**
     * Fetch metric readings for a particular role.
     *
     * Fetch metric readings for a particular role. &lt;p&gt; By default, this call will look up all metrics available for the role. If only specific metrics are desired, use the &lt;i&gt;metrics&lt;/i&gt; parameter. &lt;p&gt; By default, the returned results correspond to a 5 minute window based on the provided end time (which defaults to the current server time). The &lt;i&gt;from&lt;/i&gt; and &lt;i&gt;to&lt;/i&gt; parameters can be used to control the window being queried. A maximum window of 3 hours is enforced. &lt;p&gt; When requesting a \&quot;full\&quot; view, aside from the extended properties of the returned metric data, the collection will also contain information about all metrics available for the role, even if no readings are available in the requested window.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void getMetricsTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        String from = null;
        List<String> metrics = null;
        String to = null;
        String view = null;
        ApiMetricList response = api.getMetrics(clusterName, roleName, serviceName, from, metrics, to, view);

        // TODO: test validations
    }
    /**
     * Retrieves the stacks log file, if any, for the role&#x27;s main process.
     *
     * Retrieves the stacks log file, if any, for the role&#x27;s main process. Note that not all roles support periodic stacks collection.  The log files are returned as plain text (type \&quot;text/plain\&quot;).
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void getStacksLogTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        String response = api.getStacksLog(clusterName, roleName, serviceName);

        // TODO: test validations
    }
    /**
     * Download a zip-compressed archive of role stacks logs.
     *
     * Download a zip-compressed archive of role stacks logs. Note that not all roles support periodic stacks collection.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void getStacksLogsBundleTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        File response = api.getStacksLogsBundle(clusterName, roleName, serviceName);

        // TODO: test validations
    }
    /**
     * Retrieves the role&#x27;s standard error output.
     *
     * Retrieves the role&#x27;s standard error output. &lt;p&gt; If the role is not started, this will be the output associated with the last time the role was run. &lt;p&gt; Log files are returned as plain text (type \&quot;text/plain\&quot;).
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void getStandardErrorTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        String response = api.getStandardError(clusterName, roleName, serviceName);

        // TODO: test validations
    }
    /**
     * Retrieves the role&#x27;s standard output.
     *
     * Retrieves the role&#x27;s standard output. &lt;p&gt; If the role is not started, this will be the output associated with the last time the role was run. &lt;p&gt; Log files are returned as plain text (type \&quot;text/plain\&quot;).
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void getStandardOutputTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        String response = api.getStandardOutput(clusterName, roleName, serviceName);

        // TODO: test validations
    }
    /**
     * Collects diagnostics data for an Impala role.
     *
     * Collects diagnostics data for an Impala role.  &lt;p&gt; Available since API v31. &lt;/p&gt;
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void impalaDiagnosticsTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        ApiImpalaRoleDiagnosticsArgs body = null;
        ApiCommand response = api.impalaDiagnostics(clusterName, roleName, serviceName, body);

        // TODO: test validations
    }
    /**
     * List active role commands.
     *
     * List active role commands.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void listActiveCommandsTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        String view = null;
        ApiCommandList response = api.listActiveCommands(clusterName, roleName, serviceName, view);

        // TODO: test validations
    }
    /**
     * Lists all the commands that can be executed by name on the provided role.
     *
     * Lists all the commands that can be executed by name on the provided role.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void listCommandsTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        ApiCommandMetadataList response = api.listCommands(clusterName, roleName, serviceName);

        // TODO: test validations
    }
    /**
     * Retrieves detailed information about a role.
     *
     * Retrieves detailed information about a role.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void readRoleTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        String view = null;
        ApiRole response = api.readRole(clusterName, roleName, serviceName, view);

        // TODO: test validations
    }
    /**
     * Retrieves the configuration of a specific role.
     *
     * Retrieves the configuration of a specific role. Note that the \&quot;full\&quot; view performs validation on the configuration, which could take a few seconds on a large cluster (around 500 nodes or more).
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void readRoleConfigTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        String view = null;
        ApiConfigList response = api.readRoleConfig(clusterName, roleName, serviceName, view);

        // TODO: test validations
    }
    /**
     * Lists all roles of a given service.
     *
     * Lists all roles of a given service.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void readRolesTest() throws Exception {
        String clusterName = null;
        String serviceName = null;
        String filter = null;
        String view = null;
        ApiRoleList response = api.readRoles(clusterName, serviceName, filter, view);

        // TODO: test validations
    }
    /**
     * Retrieves all the roles in the service, including all the configurations for each role.
     *
     * Retrieves all the roles in the service, including all the configurations for each role.  This API does not retrieve the configs for the *service*,only the configs in the *roles* in the service.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void readRolesConfigTest() throws Exception {
        String clusterName = null;
        String serviceName = null;
        java.math.BigDecimal limit = null;
        java.math.BigDecimal offset = null;
        String view = null;
        ApiRoleConfigList response = api.readRolesConfig(clusterName, serviceName, limit, offset, view);

        // TODO: test validations
    }
    /**
     * Returns the tags associated with this role.
     *
     * Returns the tags associated with this role. Tag names beginning with the prefix _cldr_ (case insensitive) are reserved for internal use by Cloudera.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void readTagsTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        java.math.BigDecimal limit = null;
        java.math.BigDecimal offset = null;
        List<ApiEntityTag> response = api.readTags(clusterName, roleName, serviceName, limit, offset);

        // TODO: test validations
    }
    /**
     * Updates the role configuration with the given values.
     *
     * Updates the role configuration with the given values. &lt;p&gt; If a value is set in the given configuration, it will be added to the role&#x27;s configuration, replacing any existing entries. If a value is unset (its value is null), the existing configuration for the attribute will be erased, if any. &lt;p&gt; Attributes that are not listed in the input will maintain their current values in the configuration.
     *
     * @throws Exception
     *          if the Api call fails
     */
    @Test
    public void updateRoleConfigTest() throws Exception {
        String clusterName = null;
        String roleName = null;
        String serviceName = null;
        ApiConfigList body = null;
        String message = null;
        ApiConfigList response = api.updateRoleConfig(clusterName, roleName, serviceName, body, message);

        // TODO: test validations
    }
}
