ServiceType for Marconi/Cloud Queues.

This commit is contained in:
Everett Toews 2013-10-11 12:27:26 -05:00
parent 747fde69e9
commit 3172e0bc11
7 changed files with 114 additions and 46 deletions

View File

@ -47,7 +47,7 @@ public interface ServiceType {
public static final String IDENTITY = "identity";
/**
* Network Service (Quantum)
* Network Service (Neutron)
*/
public static final String NETWORK = "network";
@ -57,7 +57,12 @@ public interface ServiceType {
public static final String BLOCK_STORAGE = "volume";
/**
* Database Service (RedDwarf)
* Database Service (Trove)
*/
public static final String DATABASE_SERVICE = "databases";
/**
* Queues Service (Marconi)
*/
public static final String QUEUES = "queuing";
}

View File

@ -31,13 +31,7 @@ import org.jclouds.openstack.keystone.v2_0.domain.User;
import org.jclouds.rest.annotations.SelectJson;
import org.testng.annotations.Test;
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.IDENTITY;
import static org.jclouds.openstack.v2_0.ServiceType.IMAGE;
import static org.jclouds.openstack.v2_0.ServiceType.NETWORK;
import static org.jclouds.openstack.v2_0.ServiceType.OBJECT_STORE;
import static org.jclouds.openstack.v2_0.ServiceType.*;
/**
@ -57,22 +51,22 @@ public class ParseAccessTest extends BaseItemParserTest<Access> {
public Access expected() {
return Access.builder()
.token(Token.builder()
.expires(new SimpleDateFormatDateService().iso8601DateParse("2012-01-18T21:35:59.050Z"))
.id("Auth_4f173437e4b013bee56d1007")
.tenant(Tenant.builder().id("40806637803162").name("user@jclouds.org-default-tenant").build()).build())
.expires(new SimpleDateFormatDateService().iso8601DateParse("2012-01-18T21:35:59.050Z"))
.id("Auth_4f173437e4b013bee56d1007")
.tenant(Tenant.builder().id("40806637803162").name("user@jclouds.org-default-tenant").build()).build())
.user(User.builder()
.id("36980896575174").name("user@jclouds.org")
.role(Role.builder().id("00000000004022").serviceId("110").name("Admin").tenantId("40806637803162").build())
.role(Role.builder().id("00000000004024").serviceId("140").name("user").tenantId("40806637803162").build())
.role(Role.builder().id("00000000004004").serviceId("100").name("domainuser").build())
.role(Role.builder().id("00000000004016").serviceId("120").name("netadmin").tenantId("40806637803162").build()).build())
.id("36980896575174").name("user@jclouds.org")
.role(Role.builder().id("00000000004022").serviceId("110").name("Admin").tenantId("40806637803162").build())
.role(Role.builder().id("00000000004024").serviceId("140").name("user").tenantId("40806637803162").build())
.role(Role.builder().id("00000000004004").serviceId("100").name("domainuser").build())
.role(Role.builder().id("00000000004016").serviceId("120").name("netadmin").tenantId("40806637803162").build()).build())
.service(Service.builder().name("Object Storage").type(OBJECT_STORE)
.endpoint(Endpoint.builder()
.tenantId("40806637803162")
.publicURL("https://objects.jclouds.org/v1.0/40806637803162")
.adminURL("https://objects.jclouds.org/v1.0/")
.id("1.0")
.region("region-a.geo-1").build()).build())
.endpoint(Endpoint.builder()
.tenantId("40806637803162")
.publicURL("https://objects.jclouds.org/v1.0/40806637803162")
.adminURL("https://objects.jclouds.org/v1.0/")
.id("1.0")
.region("region-a.geo-1").build()).build())
.service(Service.builder().name("Identity").type(IDENTITY)
.endpoint(Endpoint.builder()
.publicURL("https://csnode.jclouds.org/v2.0/")
@ -88,19 +82,19 @@ public class ParseAccessTest extends BaseItemParserTest<Access> {
.id("1.0").build()).build())
.service(Service.builder().name("Compute").type(COMPUTE)
.endpoint(Endpoint.builder()
.tenantId("3456")
.publicURL("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456")
.region("az-1.region-a.geo-1")
.versionId("1.1")
.versionInfo("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/")
.versionList("https://az-1.region-a.geo-1.compute.hpcloudsvc.com").build())
.tenantId("3456")
.publicURL("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456")
.region("az-1.region-a.geo-1")
.versionId("1.1")
.versionInfo("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/")
.versionList("https://az-1.region-a.geo-1.compute.hpcloudsvc.com").build())
.endpoint(Endpoint.builder()
.tenantId("3456")
.publicURL("https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456")
.region("az-2.region-a.geo-1")
.versionId("1.1")
.versionInfo("https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/")
.versionList("https://az-2.region-a.geo-1.compute.hpcloudsvc.com").build())
.tenantId("3456")
.publicURL("https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456")
.region("az-2.region-a.geo-1")
.versionId("1.1")
.versionInfo("https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v1.1/")
.versionList("https://az-2.region-a.geo-1.compute.hpcloudsvc.com").build())
.endpoint(Endpoint.builder()
.tenantId("3456")
.publicURL("https://az-3.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456")
@ -127,16 +121,23 @@ public class ParseAccessTest extends BaseItemParserTest<Access> {
.service(Service.builder().name("cinder").type(BLOCK_STORAGE)
.endpoint(Endpoint.builder()
.id("08330c2dcbfc4c6c8dc7a0949fbf5da7")
.publicURL("http://172.16.0.1:8776/v1/50cdb4c60374463198695d9f798fa34d")
.internalURL("http://10.0.2.15:8776/v1/50cdb4c60374463198695d9f798fa34d")
.adminURL("http://10.0.2.15:8776/v1/50cdb4c60374463198695d9f798fa34d")
.region("RegionOne").build()).build())
.id("08330c2dcbfc4c6c8dc7a0949fbf5da7")
.publicURL("http://172.16.0.1:8776/v1/50cdb4c60374463198695d9f798fa34d")
.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)
.endpoint(Endpoint.builder()
.publicURL("http://172.16.0.1:8776/v1/3456")
.tenantId("123123")
.region("RegionOne").build()).build())
.publicURL("http://172.16.0.1:8776/v1/3456")
.tenantId("123123")
.region("RegionOne").build()).build())
.service(Service.builder().name("marconi").type(QUEUES)
.endpoint(Endpoint.builder()
.id("3456789")
.publicURL("http://172.16.0.1:8888")
.internalURL("http://10.0.2.15:8888")
.adminURL("http://10.0.2.15:8888")
.region("RegionOne").build()).build())
.service(Service.builder().name("dns").type("dns")
.endpoint(Endpoint.builder()
.publicURL("http://172.16.0.1:8776/v1/3456")

View File

@ -118,6 +118,17 @@ public class ParseRackspaceAccessTest extends BaseItemParserTest<Access> {
.endpoint(Endpoint.builder()
.tenantId("MossoCloudFS_dc1f419c-5059-4c87-a389-3f2e33a77b22")
.publicURL("https://cdn1.clouddrive.com/v1/MossoCloudFS_dc1f419c-5059-4c87-a389-3f2e33a77b22")
.region("DFW").build()).build()).build();
.region("DFW").build()).build())
.service(Service.builder().name("cloudQueues").type("rax:queues")
.endpoint(Endpoint.builder()
.tenantId("40806637803162")
.publicURL("https://dfw.queues.api.rackspacecloud.com/v1/40806637803162")
.internalURL("https://snet-dfw.queues.api.rackspacecloud.com/v1/40806637803162")
.region("DFW").build())
.endpoint(Endpoint.builder()
.tenantId("40806637803162")
.publicURL("https://ord.queues.api.rackspacecloud.com/v1/40806637803162")
.internalURL("https://snet-ord.queues.api.rackspacecloud.com/v1/40806637803162")
.region("ORD").build()).build()).build();
}
}

View File

@ -165,6 +165,20 @@
}
]
},
{
"type": "queuing",
"name": "marconi",
"endpoints": [
{
"adminURL": "http://10.0.2.15:8888",
"region": "RegionOne",
"internalURL": "http://10.0.2.15:8888",
"id": "3456789",
"publicURL": "http://172.16.0.1:8888"
}
],
"endpoints_links": []
},
{
"type": "dns",
"name": "dns",

View File

@ -96,6 +96,20 @@
}],
"name": "cloudFilesCDN",
"type": "rax:object-cdn"
}, {
"endpoints": [{
"internalURL": "https:\/\/snet-dfw.queues.api.rackspacecloud.com/v1/40806637803162",
"publicURL": "https:\/\/dfw.queues.api.rackspacecloud.com\/v1\/40806637803162",
"tenantId": "40806637803162",
"region": "DFW"
}, {
"internalURL": "https:\/\/snet-ord.queues.api.rackspacecloud.com/v1/40806637803162",
"publicURL": "https:\/\/ord.queues.api.rackspacecloud.com\/v1\/40806637803162",
"tenantId": "40806637803162",
"region": "ORD"
}],
"type": "rax:queues",
"name": "cloudQueues"
}],
"user": {
"id": "54321",

View File

@ -29,7 +29,12 @@ public interface ServiceType {
public static final String LOAD_BALANCERS = "rax:load-balancer";
/**
* Cloud Load DNS
* Cloud DNS
*/
public static final String DNS = "rax:dns";
/**
* Cloud Queues
*/
public static final String QUEUES = "rax:queues";
}

View File

@ -149,6 +149,24 @@
"region": "DFW"
}
]
},
{
"type": "rax:queues",
"name": "cloudQueues",
"endpoints": [
{
"internalURL": "https://snet-ord.queues.api.rackspacecloud.com/v1/123123",
"publicURL": "https://ord.queues.api.rackspacecloud.com/v1/123123",
"tenantId": "123123",
"region": "ORD"
},
{
"internalURL": "https://snet-dfw.queues.api.rackspacecloud.com/v1/123123",
"publicURL": "https://dfw.queues.api.rackspacecloud.com/v1/123123",
"tenantId": "123123",
"region": "DFW"
}
]
}
],
"token": {