Search in sources :

Example 1 with PropertyInfoUpdate

use of com.emc.storageos.model.property.PropertyInfoUpdate in project coprhd-controller by CoprHD.

the class ConfigService method incrementCertificateVersion.

/**
 * Update system configuration properties
 *
 * @brief Update system properties
 * @prereq Cluster state should be STABLE
 * @return Cluster information
 */
@PUT
@Path("internal/certificate-version")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response incrementCertificateVersion() throws Exception {
    PropertyInfoRestRep targetPropInfo = getTargetPropsCommon();
    String versionStr = targetPropInfo.getProperty(CERTIFICATE_VERSION);
    Integer version = new Integer(versionStr);
    PropertyInfoUpdate setProperty = new PropertyInfoUpdate();
    setProperty.addProperty(CERTIFICATE_VERSION, (++version).toString());
    _log.info("setProperties(): {}", setProperty);
    PropertyInfoRestRep updateProps = getUpdateProps(setProperty, targetPropInfo.getAllProperties());
    return updatePropertiesCommon(updateProps, null);
}
Also used : PropertyInfoRestRep(com.emc.storageos.model.property.PropertyInfoRestRep) PropertyInfoUpdate(com.emc.storageos.model.property.PropertyInfoUpdate)

Example 2 with PropertyInfoUpdate

use of com.emc.storageos.model.property.PropertyInfoUpdate in project coprhd-controller by CoprHD.

the class ConfigService method configureConnectEmcFtpsParams.

/**
 * Configure ConnectEMC FTPS transport related properties
 *
 * @brief Configure ConnectEMC FTPS properties
 * @prereq Cluster state should be STABLE
 * @return ConnectEMC FTPS related properties
 */
@POST
@Path("connectemc/ftps/")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.RESTRICTED_SYSTEM_ADMIN })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response configureConnectEmcFtpsParams(ConnectEmcFtps ftpsParams) throws Exception {
    PropertyInfoUpdate ext = ConfigService.ConfigureConnectEmc.configureFtps(ftpsParams);
    PropertyInfoRestRep targetPropInfo = getTargetPropsCommon();
    PropertyInfoRestRep updateProps = getUpdateProps(ext, targetPropInfo.getAllProperties());
    return updatePropertiesCommon(updateProps, null);
}
Also used : PropertyInfoRestRep(com.emc.storageos.model.property.PropertyInfoRestRep) PropertyInfoUpdate(com.emc.storageos.model.property.PropertyInfoUpdate) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Example 3 with PropertyInfoUpdate

use of com.emc.storageos.model.property.PropertyInfoUpdate in project coprhd-controller by CoprHD.

the class ConfigService method configureConnectEmcEmailParams.

/**
 * Configure ConnectEMC SMTP/Email transport related properties
 *
 * @brief Configure ConnectEMC SMTP/Email properties
 * @prereq Cluster state should be STABLE
 * @return Properties related to ConnectEMC Email
 */
@POST
@Path("connectemc/email/")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.RESTRICTED_SYSTEM_ADMIN })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response configureConnectEmcEmailParams(ConnectEmcEmail emailParams) throws Exception {
    PropertyInfoRestRep targetPropInfo = getTargetPropsCommon();
    PropertyInfoUpdate ext = ConfigService.ConfigureConnectEmc.configureEmail(emailParams);
    PropertyInfoRestRep updateProps = getUpdateProps(ext, targetPropInfo.getAllProperties());
    return updatePropertiesCommon(updateProps, null);
}
Also used : PropertyInfoRestRep(com.emc.storageos.model.property.PropertyInfoRestRep) PropertyInfoUpdate(com.emc.storageos.model.property.PropertyInfoUpdate) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Example 4 with PropertyInfoUpdate

use of com.emc.storageos.model.property.PropertyInfoUpdate in project coprhd-controller by CoprHD.

the class ConfigServiceTest method testFtps.

@Test
public void testFtps() {
    ConnectEmcFtps ftps = new ConnectEmcFtps();
    ftps.setSafeEncryption("no");
    ftps.setEmailServer("mailhub.lss.emc.com");
    ftps.setNotifyEmailAddress("joe.customer@customer.com");
    try {
        ftps.setHostName("corpusfep3.emc.com");
    } catch (Exception e) {
        Assert.fail();
    }
    PropertyInfoUpdate propInfo = ConfigService.ConfigureConnectEmc.configureFtps(ftps);
    Assert.assertEquals(propInfo.getProperty("system_connectemc_encrypt"), ftps.getSafeEncryption());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_ftps_hostname"), ftps.getHostName());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_server"), ftps.getEmailServer());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_to"), ftps.getNotifyEmailAddress());
}
Also used : ConnectEmcFtps(com.emc.vipr.model.sys.eventhandler.ConnectEmcFtps) PropertyInfoUpdate(com.emc.storageos.model.property.PropertyInfoUpdate) Test(org.junit.Test)

Example 5 with PropertyInfoUpdate

use of com.emc.storageos.model.property.PropertyInfoUpdate in project coprhd-controller by CoprHD.

the class ConfigServiceTest method testEmailUsingAuth.

@Test
public void testEmailUsingAuth() {
    ConnectEmcEmail email = new ConnectEmcEmail();
    email.setEmailSender("DONOTREPLY@customer.com");
    email.setEmailServer("mailhub.lss.emc.com");
    email.setNotifyEmailAddress("joe.customer@customer.com");
    email.setPrimaryEmailAddress("emailalertesg@emc.com");
    email.setSafeEncryption("no");
    email.setUserName("root");
    email.setPassword("ChangeMe");
    try {
        email.setSmtpAuthType("login");
    } catch (Exception e) {
        Assert.fail();
    }
    PropertyInfoUpdate propInfo = ConfigService.ConfigureConnectEmc.configureEmail(email);
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_server"), email.getEmailServer());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_emcto"), email.getPrimaryEmailAddress());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_from"), email.getEmailSender());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_to"), email.getNotifyEmailAddress());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_enabletls"), email.getStartTls());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_encrypt"), email.getSafeEncryption());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_authtype"), email.getSmtpAuthType());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_username"), email.getUserName());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_password"), email.getPassword());
}
Also used : ConnectEmcEmail(com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail) PropertyInfoUpdate(com.emc.storageos.model.property.PropertyInfoUpdate) Test(org.junit.Test)

Aggregations

PropertyInfoUpdate (com.emc.storageos.model.property.PropertyInfoUpdate)12 Test (org.junit.Test)5 ConnectEmcEmail (com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail)4 PropertyInfoRestRep (com.emc.storageos.model.property.PropertyInfoRestRep)3 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)2 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)2 CoordinatorClientException (com.emc.storageos.systemservices.exceptions.CoordinatorClientException)2 LocalRepositoryException (com.emc.storageos.systemservices.exceptions.LocalRepositoryException)2 ConnectEmcFtps (com.emc.vipr.model.sys.eventhandler.ConnectEmcFtps)1 Calendar (java.util.Calendar)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1