Search in sources :

Example 6 with PropertyInstance

use of org.opentosca.toscana.core.transformation.properties.PropertyInstance in project TOSCAna by StuPro-TOSCAna.

the class CloudFormationExpressIT method getInputs.

@Override
protected PropertyInstance getInputs(EffectiveModel model) throws NoSuchPropertyException {
    PropertyInstance props = new PropertyInstance(new HashSet<>(plugin.getPlatform().properties), mock(Transformation.class));
    props.set(AWS_ACCESS_KEY_ID_KEY, accessKey);
    props.set(AWS_SECRET_KEY_KEY, secretKey);
    props.set(AWS_KEYPAIR_KEY, "true");
    return props;
}
Also used : Transformation(org.opentosca.toscana.core.transformation.Transformation) PropertyInstance(org.opentosca.toscana.core.transformation.properties.PropertyInstance)

Example 7 with PropertyInstance

use of org.opentosca.toscana.core.transformation.properties.PropertyInstance in project TOSCAna by StuPro-TOSCAna.

the class CloudFoundryLampITinput method getInputs.

protected PropertyInstance getInputs(EffectiveModel model) throws NoSuchPropertyException {
    Set<InputProperty> prop = new HashSet<>(plugin.getPlatform().properties);
    prop.addAll(model.getInputs().values());
    PropertyInstance props = new PropertyInstance(prop, mock(Transformation.class));
    props.set("database_name", "name");
    props.set("database_user", "user");
    props.set("database_port", "3333");
    props.set("database_password", "secrets");
    props.set(CF_PROPERTY_KEY_USERNAME, envUser);
    props.set(CF_PROPERTY_KEY_PASSWORD, envPw);
    props.set(CF_PROPERTY_KEY_API, envHost);
    props.set(CF_PROPERTY_KEY_ORGANIZATION, envOrga);
    props.set(CF_PROPERTY_KEY_SPACE, envSpace);
    return props;
}
Also used : Transformation(org.opentosca.toscana.core.transformation.Transformation) InputProperty(org.opentosca.toscana.core.transformation.properties.InputProperty) PropertyInstance(org.opentosca.toscana.core.transformation.properties.PropertyInstance) HashSet(java.util.HashSet)

Example 8 with PropertyInstance

use of org.opentosca.toscana.core.transformation.properties.PropertyInstance in project TOSCAna by StuPro-TOSCAna.

the class CloudFoundryLampMultiNode method getInputs.

protected PropertyInstance getInputs(EffectiveModel model) throws NoSuchPropertyException {
    Set<InputProperty> prop = new HashSet<>(plugin.getPlatform().properties);
    prop.addAll(model.getInputs().values());
    PropertyInstance props = new PropertyInstance(prop, mock(Transformation.class));
    props.set(CF_PROPERTY_KEY_USERNAME, envUser);
    props.set(CF_PROPERTY_KEY_PASSWORD, envPw);
    props.set(CF_PROPERTY_KEY_API, envHost);
    props.set(CF_PROPERTY_KEY_ORGANIZATION, envOrga);
    props.set(CF_PROPERTY_KEY_SPACE, envSpace);
    return props;
}
Also used : Transformation(org.opentosca.toscana.core.transformation.Transformation) InputProperty(org.opentosca.toscana.core.transformation.properties.InputProperty) PropertyInstance(org.opentosca.toscana.core.transformation.properties.PropertyInstance) HashSet(java.util.HashSet)

Example 9 with PropertyInstance

use of org.opentosca.toscana.core.transformation.properties.PropertyInstance in project TOSCAna by StuPro-TOSCAna.

the class KubernetesJavaTranslatorIT method getInputs.

@Override
protected PropertyInstance getInputs(EffectiveModel model) throws NoSuchPropertyException {
    PropertyInstance instance = super.getInputs(model);
    // Set the required model inputs
    instance.set("database_name", "stadb");
    instance.set("database_user", "stadb");
    instance.set("database_port", "3306");
    instance.set("database_password", "TOSCA_rulez");
    return instance;
}
Also used : PropertyInstance(org.opentosca.toscana.core.transformation.properties.PropertyInstance)

Example 10 with PropertyInstance

use of org.opentosca.toscana.core.transformation.properties.PropertyInstance in project TOSCAna by StuPro-TOSCAna.

the class KubernetesPushingGopherIT method getInputs.

@Override
protected PropertyInstance getInputs(EffectiveModel model) throws NoSuchPropertyException {
    Set<InputProperty> prop = new HashSet<>(plugin.getPlatform().properties);
    prop.addAll(model.getInputs().values());
    PropertyInstance instance = new PropertyInstance(prop, mock(Transformation.class));
    instance.set(DOCKER_PUSH_TO_REGISTRY_PROPERTY_KEY, "true");
    instance.set(DOCKER_REGISTRY_USERNAME_PROPERTY_KEY, "test");
    instance.set(DOCKER_REGISTRY_PASSWORD_PROPERTY_KEY, "");
    instance.set(DOCKER_REGISTRY_URL_PROPERTY_KEY, "127.0.0.1:5000/");
    instance.set(DOCKER_REGISTRY_REPOSITORY_PROPERTY_KEY, "gopher");
    return instance;
}
Also used : Transformation(org.opentosca.toscana.core.transformation.Transformation) InputProperty(org.opentosca.toscana.core.transformation.properties.InputProperty) PropertyInstance(org.opentosca.toscana.core.transformation.properties.PropertyInstance) HashSet(java.util.HashSet)

Aggregations

PropertyInstance (org.opentosca.toscana.core.transformation.properties.PropertyInstance)11 Transformation (org.opentosca.toscana.core.transformation.Transformation)9 HashSet (java.util.HashSet)6 InputProperty (org.opentosca.toscana.core.transformation.properties.InputProperty)5 Csar (org.opentosca.toscana.core.csar.Csar)2 NoSuchPropertyException (org.opentosca.toscana.core.transformation.properties.NoSuchPropertyException)2 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 File (java.io.File)1 HashMap (java.util.HashMap)1 Test (org.junit.Test)1 IllegalTransformationStateException (org.opentosca.toscana.api.exceptions.IllegalTransformationStateException)1 GetInputsResponse (org.opentosca.toscana.api.model.GetInputsResponse)1 InputWrap (org.opentosca.toscana.api.model.InputWrap)1 InputsResponse (org.opentosca.toscana.api.model.InputsResponse)1 BaseUnitTest (org.opentosca.toscana.core.BaseUnitTest)1 CsarImpl (org.opentosca.toscana.core.csar.CsarImpl)1 TransformationContext (org.opentosca.toscana.core.transformation.TransformationContext)1 TransformationImpl (org.opentosca.toscana.core.transformation.TransformationImpl)1 TransformationState (org.opentosca.toscana.core.transformation.TransformationState)1