Search in sources :

Example 1 with V3CloudInit

use of org.ovirt.engine.api.v3.types.V3CloudInit in project ovirt-engine by oVirt.

the class V3CloudInitOutAdapter method adapt.

@Override
public V3CloudInit adapt(CloudInit from) {
    V3CloudInit to = new V3CloudInit();
    if (from.isSetAuthorizedKeys()) {
        to.setAuthorizedKeys(new V3AuthorizedKeys());
        to.getAuthorizedKeys().getAuthorizedKeys().addAll(adaptOut(from.getAuthorizedKeys().getAuthorizedKeys()));
    }
    if (from.isSetFiles()) {
        to.setFiles(new V3Files());
        to.getFiles().getFiles().addAll(adaptOut(from.getFiles().getFiles()));
    }
    if (from.isSetHost()) {
        to.setHost(adaptOut(from.getHost()));
    }
    if (from.isSetNetworkConfiguration()) {
        to.setNetworkConfiguration(adaptOut(from.getNetworkConfiguration()));
    }
    if (from.isSetRegenerateSshKeys()) {
        to.setRegenerateSshKeys(from.isRegenerateSshKeys());
    }
    if (from.isSetTimezone()) {
        to.setTimezone(from.getTimezone());
    }
    if (from.isSetUsers()) {
        to.setUsers(new V3Users());
        to.getUsers().getUsers().addAll(adaptOut(from.getUsers().getUsers()));
    }
    return to;
}
Also used : V3Files(org.ovirt.engine.api.v3.types.V3Files) V3CloudInit(org.ovirt.engine.api.v3.types.V3CloudInit) V3Users(org.ovirt.engine.api.v3.types.V3Users) V3AuthorizedKeys(org.ovirt.engine.api.v3.types.V3AuthorizedKeys)

Example 2 with V3CloudInit

use of org.ovirt.engine.api.v3.types.V3CloudInit in project ovirt-engine by oVirt.

the class V3CloudInitInAdapter method adapt.

@Override
public CloudInit adapt(V3CloudInit from) {
    CloudInit to = new CloudInit();
    if (from.isSetAuthorizedKeys()) {
        to.setAuthorizedKeys(new AuthorizedKeys());
        to.getAuthorizedKeys().getAuthorizedKeys().addAll(adaptIn(from.getAuthorizedKeys().getAuthorizedKeys()));
    }
    if (from.isSetFiles()) {
        to.setFiles(new Files());
        to.getFiles().getFiles().addAll(adaptIn(from.getFiles().getFiles()));
    }
    if (from.isSetHost()) {
        to.setHost(adaptIn(from.getHost()));
    }
    if (from.isSetNetworkConfiguration()) {
        to.setNetworkConfiguration(adaptIn(from.getNetworkConfiguration()));
    }
    if (from.isSetRegenerateSshKeys()) {
        to.setRegenerateSshKeys(from.isRegenerateSshKeys());
    }
    if (from.isSetTimezone()) {
        to.setTimezone(from.getTimezone());
    }
    if (from.isSetUsers()) {
        to.setUsers(new Users());
        to.getUsers().getUsers().addAll(adaptIn(from.getUsers().getUsers()));
    }
    return to;
}
Also used : AuthorizedKeys(org.ovirt.engine.api.model.AuthorizedKeys) V3CloudInit(org.ovirt.engine.api.v3.types.V3CloudInit) CloudInit(org.ovirt.engine.api.model.CloudInit) Users(org.ovirt.engine.api.model.Users) Files(org.ovirt.engine.api.model.Files)

Aggregations

V3CloudInit (org.ovirt.engine.api.v3.types.V3CloudInit)2 AuthorizedKeys (org.ovirt.engine.api.model.AuthorizedKeys)1 CloudInit (org.ovirt.engine.api.model.CloudInit)1 Files (org.ovirt.engine.api.model.Files)1 Users (org.ovirt.engine.api.model.Users)1 V3AuthorizedKeys (org.ovirt.engine.api.v3.types.V3AuthorizedKeys)1 V3Files (org.ovirt.engine.api.v3.types.V3Files)1 V3Users (org.ovirt.engine.api.v3.types.V3Users)1