mirror of https://github.com/apache/jclouds.git
Properties builder for Nova,
simple client app to test API
This commit is contained in:
parent
6a3ce93d26
commit
159224de89
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
*
|
||||
* 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.openstack.nova;
|
||||
|
||||
import org.jclouds.PropertiesBuilder;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* Builds properties used in Openstack Nova Clients
|
||||
*
|
||||
* @author Dmitri Babaev
|
||||
*/
|
||||
public class NovaPropertiesBuilder extends PropertiesBuilder {
|
||||
@Override
|
||||
protected Properties defaultProperties() {
|
||||
Properties properties = super.defaultProperties();
|
||||
return properties;
|
||||
}
|
||||
|
||||
public NovaPropertiesBuilder(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
public NovaPropertiesBuilder() {
|
||||
super();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package org.jclouds.openstack.nova;
|
||||
|
||||
import org.jclouds.compute.ComputeServiceContextFactory;
|
||||
import org.jclouds.compute.ComputeServiceContext;
|
||||
import org.jclouds.ssh.jsch.config.JschSshClientModule;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Properties;
|
||||
|
||||
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
|
||||
|
||||
public class _NovaClient {
|
||||
static public void main(String[] args) {
|
||||
String identity = "admin";
|
||||
String credential = "";
|
||||
String endpoint = "";
|
||||
|
||||
ComputeServiceContextFactory contextFactory = new ComputeServiceContextFactory();
|
||||
|
||||
Properties overrides = new Properties();
|
||||
overrides.setProperty(PROPERTY_ENDPOINT, endpoint);
|
||||
ComputeServiceContext context = contextFactory.createContext("nova", identity, credential, Collections.singleton(new JschSshClientModule()), overrides);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue