Updated service types for OpenStack/Rackspace services

This commit is contained in:
Jeremy Daggett 2014-04-10 08:35:04 -07:00
parent f1a0370bd0
commit b112e8069e
6 changed files with 58 additions and 29 deletions

View File

@ -66,8 +66,8 @@ public class KeystoneApiMetadata extends BaseRestApiMetadata {
public static Properties defaultProperties() {
Properties properties = BaseRestApiMetadata.defaultProperties();
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
properties.setProperty(SERVICE_TYPE, ServiceType.IDENTITY);
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
return properties;
}

View File

@ -22,47 +22,51 @@ package org.jclouds.openstack.v2_0;
* (presumably useful) operations.
*
* @author Adrian Cole
* @see <a href="http://docs.openstack.org/api/openstack-typeentity-service/2.0/content/Identity-Service-Concepts-e1362.html"
* />
* @author Jeremy Daggett
*/
public interface ServiceType {
/**
* Object Storage (Swift)
*/
public static final String OBJECT_STORE = "object-store";
String OBJECT_STORE = "object-store";
/**
* Compute (Nova)
*/
public static final String COMPUTE = "compute";
String COMPUTE = "compute";
/**
* Image Service (Glance)
*/
public static final String IMAGE = "image";
String IMAGE = "image";
/**
* Identity Service (Keystone)
*/
public static final String IDENTITY = "identity";
String IDENTITY = "identity";
/**
* Network Service (Neutron)
*/
public static final String NETWORK = "network";
String NETWORK = "network";
/**
* Block Storage (Cinder)
*/
public static final String BLOCK_STORAGE = "volume";
String BLOCK_STORAGE = "volume";
/**
* Database Service (Trove)
*/
public static final String DATABASE_SERVICE = "databases";
String DATABASE = "database";
/**
* Queues Service (Marconi)
*/
public static final String QUEUES = "queuing";
String QUEUES = "queuing";
/**
* Orchestration Service (Heat)
*/
String ORCHESTRATION = "orchestration";
}

View File

@ -33,7 +33,7 @@ import javax.ws.rs.core.MediaType;
import static org.jclouds.openstack.v2_0.ServiceType.BLOCK_STORAGE;
import static org.jclouds.openstack.v2_0.ServiceType.COMPUTE;
import static org.jclouds.openstack.v2_0.ServiceType.DATABASE_SERVICE;
import static org.jclouds.openstack.v2_0.ServiceType.DATABASE;
import static org.jclouds.openstack.v2_0.ServiceType.IDENTITY;
import static org.jclouds.openstack.v2_0.ServiceType.IMAGE;
import static org.jclouds.openstack.v2_0.ServiceType.NETWORK;
@ -132,7 +132,7 @@ public class ParseAccessTest extends BaseItemParserTest<Access> {
.internalURL("http://10.0.2.15:8776/v1/50cdb4c60374463198695d9f798fa34d")
.adminURL("http://10.0.2.15:8776/v1/50cdb4c60374463198695d9f798fa34d")
.region("RegionOne").build()).build())
.service(Service.builder().name("reddwarf").type(DATABASE_SERVICE)
.service(Service.builder().name("trove").type(DATABASE)
.endpoint(Endpoint.builder()
.publicURL("http://172.16.0.1:8776/v1/3456")
.tenantId("123123")

View File

@ -155,8 +155,8 @@
"endpoints_links": []
},
{
"type": "databases",
"name": "reddwarf",
"type": "database",
"name": "trove",
"endpoints": [
{
"publicURL": "http://172.16.0.1:8776/v1/3456",

View File

@ -35,7 +35,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
/**
* Implementation of {@link ApiMetadata} for Trove API
* Implementation of {@link org.jclouds.apis.ApiMetadata} for the OpenStack Trove v1 API.
*
* @author Zack Shoylev
*/
@ -56,7 +56,7 @@ public class TroveApiMetadata extends BaseHttpApiMetadata<TroveApi> {
public static Properties defaultProperties() {
Properties properties = BaseHttpApiMetadata.defaultProperties();
properties.setProperty(SERVICE_TYPE, ServiceType.DATABASE_SERVICE);
properties.setProperty(SERVICE_TYPE, ServiceType.DATABASE);
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
return properties;
}
@ -81,7 +81,7 @@ public class TroveApiMetadata extends BaseHttpApiMetadata<TroveApi> {
.add(TroveHttpApiModule.class)
.build());
}
@Override
public TroveApiMetadata build() {
return new TroveApiMetadata(this);

View File

@ -26,20 +26,45 @@ public interface ServiceType {
/**
* Cloud Load Balancers
*/
public static final String LOAD_BALANCERS = "rax:load-balancer";
String LOAD_BALANCERS = "rax:load-balancer";
/**
* Cloud DNS
*/
public static final String DNS = "rax:dns";
String DNS = "rax:dns";
/**
* Cloud Queues
*/
public static final String QUEUES = "rax:queues";
String QUEUES = "rax:queues";
/**
* Cloud Files CDN
*/
public static final String OBJECT_CDN = "rax:object-cdn";
String OBJECT_CDN = "rax:object-cdn";
/**
* Auto Scale
*/
String AUTO_SCALE = "rax:autoscale";
/**
* Cloud Backup
*/
String BACKUP = "rax:backup";
/**
* Cloud Databases
*/
String DATABASES = "rax:database";
/**
* Cloud Monitoring
*/
String MONITORING = "rax:monitor";
/**
* Cloud Big Data
*/
String BIG_DATA = "rax:bigdata";
}