-
Notifications
You must be signed in to change notification settings - Fork 453
[JCLOUDS-1374]This is the first commit of Softlayer LoadBalancer API #1176
Conversation
thx @swaqos it looks like a great PR: jira issue, good tests (with live tests results) and use of jclouds best practices! |
public void testCreateLoadBalancer() throws Exception { | ||
assertTrue(subnetId != -1, "Please set the subnetId"); | ||
assertTrue(!testInstancePrivateIp.equals(""), "Please set the testInstancePrivateIp for Member functions testing"); | ||
loadBalancer = LoadBalancer.create(0, 0, "", new Date(), "", 0, 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you creating this mock obj instead of using line 108
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for this is because of the wait state at line 113-125, the assignment of the loadBalancer
object needs to be created (not null) for the apply
function.
@QueryParams(keys = "objectMask", values = NAME_MASK) | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Fallback(NullOnNotFoundOr404.class) | ||
LoadBalancer addLoadBalancerMembers(@WrapWith("parameters") List<Object> LoadBalancerMembersToBeAdded); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any better type than Object
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a lot of the LBaaS APIs, they are expecting the payload to be in the format of the mixture of LB uuid and the definition. For example, for updateLoadBalancerMembers
, the payload is something like {"parameters": ["<load_balancer_uuid>", [{"uuid": "<load_balancer_member_uuid>", "weight": <weight>}]]}
.
@QueryParams(keys = "objectMask", values = NAME_MASK) | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Fallback(NullOnNotFoundOr404.class) | ||
LoadBalancer updateLoadBalancerMembers(@WrapWith("parameters") List<Object> LoadBalancerMembersToBeUpdated); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any better type than Object
?
@QueryParams(keys = "objectMask", values = NAME_MASK) | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Fallback(NullOnNotFoundOr404.class) | ||
LoadBalancer deleteLoadBalancerMembers(@WrapWith("parameters") List<Object> LoadBalancerMembersToBeDeleted); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any better type than Object
?
Thanks @swaqos!
What are those properties needed for? |
|
Thanks for the explanation. Would it make sense to do like we do in the Azure ARM load balancer live test and use the ComputeService to create the instance? That way you could probably extract the subnet and private ip from the created instance and get rid of those properties. We should try to have live tests that work out of the box. |
I totally understand that out of the box live tests would be nice and I would hope that too, but that would require other information for the new subnet (networkIdentifier, cider) and new machine, not to mention the extra time needed for this (it's now taking approximately 20 mins). I wonder if there's a better way to work around this. |
Time is not an issue. Live tests are assumed to take their time. |
I think creating a new virtualGuest is not a problem, but the problem is more with the network/subnets. I believe with the new CDN accounts, virtualGuest creations require subnetId as well, while I believe subnets need to live on private networks, and there are limit number of private networks(5), at least . Depending on how the private networks are configured, the number of subnets are limited, too, so I don't know if it's safe to assume there is room for them. I will need to do some more investigations on that. |
hi @swaqos any update on that? |
Please reopen against apache/jclouds if this is still relevant. |
Jira link: https://issues.apache.org/jira/browse/JCLOUDS-1374
The update focuses on adding SoftLayer LoadBalancer API to the features list of SoftLayer provider.
Domain type files:
Features:
Notes:
subnetId
,servicePrices
, andtestInstancePrivateIp
for LoadBalancerApiLiveTest.<maven-surefire-plugin>