mirror of https://github.com/apache/jclouds.git
Line endings
This commit is contained in:
parent
8453ed1815
commit
b8df9b9ec9
|
@ -1,87 +1,87 @@
|
|||
/**
|
||||
*
|
||||
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
|
||||
*
|
||||
* ====================================================================
|
||||
* 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.jclouds.compute.domain;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.jclouds.compute.domain.internal.NodeMetadataImpl;
|
||||
import org.jclouds.domain.Credentials;
|
||||
|
||||
import com.google.inject.ImplementedBy;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
* @author Ivan Meredith
|
||||
*/
|
||||
@ImplementedBy(NodeMetadataImpl.class)
|
||||
public interface NodeMetadata extends ComputeMetadata {
|
||||
|
||||
/**
|
||||
* Tag used for all resources that belong to the same logical group. run, destroy commands are
|
||||
* scoped to tag.
|
||||
*
|
||||
* @return tag for this node, or null, if not a part of a group
|
||||
*
|
||||
*/
|
||||
String getTag();
|
||||
|
||||
/**
|
||||
*
|
||||
* The id of the image this node was created from, if possible to correlate.
|
||||
*/
|
||||
@Nullable
|
||||
String getImageId();
|
||||
|
||||
/**
|
||||
*
|
||||
* The operating system this node is running, if possible to determine.
|
||||
*/
|
||||
@Nullable
|
||||
OperatingSystem getOperatingSystem();
|
||||
|
||||
/**
|
||||
* Current State of the node
|
||||
*/
|
||||
NodeState getState();
|
||||
|
||||
/**
|
||||
* All public IP addresses, potentially including shared ips.
|
||||
*/
|
||||
Set<String> getPublicAddresses();
|
||||
|
||||
/**
|
||||
* All private IP addresses.
|
||||
*/
|
||||
Set<String> getPrivateAddresses();
|
||||
|
||||
/**
|
||||
* If possible, these are returned upon all detail requests. However, it is often the case that
|
||||
* credentials are only available at "run" time.
|
||||
*/
|
||||
Credentials getCredentials();
|
||||
|
||||
/**
|
||||
* Other variables present that the provider supports
|
||||
*/
|
||||
Map<String, String> getExtra();
|
||||
/**
|
||||
*
|
||||
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
|
||||
*
|
||||
* ====================================================================
|
||||
* 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.jclouds.compute.domain;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.jclouds.compute.domain.internal.NodeMetadataImpl;
|
||||
import org.jclouds.domain.Credentials;
|
||||
|
||||
import com.google.inject.ImplementedBy;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
* @author Ivan Meredith
|
||||
*/
|
||||
@ImplementedBy(NodeMetadataImpl.class)
|
||||
public interface NodeMetadata extends ComputeMetadata {
|
||||
|
||||
/**
|
||||
* Tag used for all resources that belong to the same logical group. run, destroy commands are
|
||||
* scoped to tag.
|
||||
*
|
||||
* @return tag for this node, or null, if not a part of a group
|
||||
*
|
||||
*/
|
||||
String getTag();
|
||||
|
||||
/**
|
||||
*
|
||||
* The id of the image this node was created from, if possible to correlate.
|
||||
*/
|
||||
@Nullable
|
||||
String getImageId();
|
||||
|
||||
/**
|
||||
*
|
||||
* The operating system this node is running, if possible to determine.
|
||||
*/
|
||||
@Nullable
|
||||
OperatingSystem getOperatingSystem();
|
||||
|
||||
/**
|
||||
* Current State of the node
|
||||
*/
|
||||
NodeState getState();
|
||||
|
||||
/**
|
||||
* All public IP addresses, potentially including shared ips.
|
||||
*/
|
||||
Set<String> getPublicAddresses();
|
||||
|
||||
/**
|
||||
* All private IP addresses.
|
||||
*/
|
||||
Set<String> getPrivateAddresses();
|
||||
|
||||
/**
|
||||
* If possible, these are returned upon all detail requests. However, it is often the case that
|
||||
* credentials are only available at "run" time.
|
||||
*/
|
||||
Credentials getCredentials();
|
||||
|
||||
/**
|
||||
* Other variables present that the provider supports
|
||||
*/
|
||||
Map<String, String> getExtra();
|
||||
}
|
|
@ -1,58 +1,58 @@
|
|||
/**
|
||||
*
|
||||
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
|
||||
*
|
||||
* ====================================================================
|
||||
* 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.jclouds.rimuhosting.miro.compute;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.jclouds.compute.BaseComputeServiceLiveTest;
|
||||
import org.jclouds.compute.domain.OsFamily;
|
||||
import org.jclouds.compute.domain.Template;
|
||||
import org.jclouds.ssh.jsch.config.JschSshClientModule;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Ivan Meredith
|
||||
*/
|
||||
@Test(groups = "live", sequential = true, testName = "rimuhosting.RimuHostingNodeServiceLiveTest")
|
||||
public class RimuHostingComputeServiceLiveTest extends BaseComputeServiceLiveTest {
|
||||
@BeforeClass
|
||||
@Override
|
||||
public void setServiceDefaults() {
|
||||
provider = "rimuhosting";
|
||||
tag = "rimuhosting.jclouds";
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTemplateBuilder() {
|
||||
Template defaultTemplate = client.templateBuilder().build();
|
||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), false);
|
||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
||||
assertEquals(defaultTemplate.getLocation().getId(), "DCDALLAS");
|
||||
assertEquals(defaultTemplate.getSize().getProviderId(), "MIRO1B");
|
||||
assertEquals(defaultTemplate.getSize().getCores(), 1.0d);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JschSshClientModule getSshModule() {
|
||||
return new JschSshClientModule();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
|
||||
*
|
||||
* ====================================================================
|
||||
* 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.jclouds.rimuhosting.miro.compute;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.jclouds.compute.BaseComputeServiceLiveTest;
|
||||
import org.jclouds.compute.domain.OsFamily;
|
||||
import org.jclouds.compute.domain.Template;
|
||||
import org.jclouds.ssh.jsch.config.JschSshClientModule;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Ivan Meredith
|
||||
*/
|
||||
@Test(groups = "live", sequential = true, testName = "rimuhosting.RimuHostingNodeServiceLiveTest")
|
||||
public class RimuHostingComputeServiceLiveTest extends BaseComputeServiceLiveTest {
|
||||
@BeforeClass
|
||||
@Override
|
||||
public void setServiceDefaults() {
|
||||
provider = "rimuhosting";
|
||||
tag = "rimuhosting.jclouds";
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTemplateBuilder() {
|
||||
Template defaultTemplate = client.templateBuilder().build();
|
||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), false);
|
||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
||||
assertEquals(defaultTemplate.getLocation().getId(), "DCDALLAS");
|
||||
assertEquals(defaultTemplate.getSize().getProviderId(), "MIRO1B");
|
||||
assertEquals(defaultTemplate.getSize().getCores(), 1.0d);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JschSshClientModule getSshModule() {
|
||||
return new JschSshClientModule();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,58 +1,58 @@
|
|||
/**
|
||||
*
|
||||
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
|
||||
*
|
||||
* ====================================================================
|
||||
* 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.jclouds.vcloud.hostingdotcom.compute;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.jclouds.compute.domain.NodeState;
|
||||
import org.jclouds.vcloud.VCloudClient;
|
||||
import org.jclouds.vcloud.compute.BaseVCloudComputeClient;
|
||||
import org.jclouds.vcloud.domain.VApp;
|
||||
import org.jclouds.vcloud.domain.VAppStatus;
|
||||
import org.jclouds.vcloud.domain.VAppTemplate;
|
||||
import org.jclouds.vcloud.hostingdotcom.domain.HostingDotComVApp;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Singleton
|
||||
public class HostingDotComVCloudComputeClient extends BaseVCloudComputeClient {
|
||||
|
||||
@Inject
|
||||
protected HostingDotComVCloudComputeClient(VCloudClient client, Predicate<URI> successTester,
|
||||
Map<VAppStatus, NodeState> vAppStatusToNodeState) {
|
||||
super(client, successTester, vAppStatusToNodeState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> parseResponse(VAppTemplate template, VApp vAppResponse) {
|
||||
HostingDotComVApp hVApp = HostingDotComVApp.class.cast(vAppResponse);
|
||||
return ImmutableMap.<String, String> of("id", vAppResponse.getId().toASCIIString(), "username", hVApp
|
||||
.getUsername(), "password", hVApp.getPassword());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
|
||||
*
|
||||
* ====================================================================
|
||||
* 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.jclouds.vcloud.hostingdotcom.compute;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.jclouds.compute.domain.NodeState;
|
||||
import org.jclouds.vcloud.VCloudClient;
|
||||
import org.jclouds.vcloud.compute.BaseVCloudComputeClient;
|
||||
import org.jclouds.vcloud.domain.VApp;
|
||||
import org.jclouds.vcloud.domain.VAppStatus;
|
||||
import org.jclouds.vcloud.domain.VAppTemplate;
|
||||
import org.jclouds.vcloud.hostingdotcom.domain.HostingDotComVApp;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Singleton
|
||||
public class HostingDotComVCloudComputeClient extends BaseVCloudComputeClient {
|
||||
|
||||
@Inject
|
||||
protected HostingDotComVCloudComputeClient(VCloudClient client, Predicate<URI> successTester,
|
||||
Map<VAppStatus, NodeState> vAppStatusToNodeState) {
|
||||
super(client, successTester, vAppStatusToNodeState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> parseResponse(VAppTemplate template, VApp vAppResponse) {
|
||||
HostingDotComVApp hVApp = HostingDotComVApp.class.cast(vAppResponse);
|
||||
return ImmutableMap.<String, String> of("id", vAppResponse.getId().toASCIIString(), "username", hVApp
|
||||
.getUsername(), "password", hVApp.getPassword());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue