Re: [jclouds/jclouds] [JCLOUDS-1468] Adding missing options for the ListUsageRecords API call. (#1259)
Thanks @mcdonnell-john for this. is there a jira issue tracking this problem, could you maybe improve the description pointing to that jira issue? Also have you signed http://apache.org/licenses/icla.pdf as per https://www.apache.org/foundation/how-it-works/legal.html#incoming-code ? Thanks again -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1259#issuecomment-441379368
[jira] [Commented] (JCLOUDS-1466) Azurecompute-arm listNodes doesn't work
[ https://issues.apache.org/jira/browse/JCLOUDS-1466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16693069#comment-16693069 ] Andrea Turli commented on JCLOUDS-1466: --- Hi, could you be more specific? :) > Azurecompute-arm listNodes doesn't work > --- > > Key: JCLOUDS-1466 > URL: https://issues.apache.org/jira/browse/JCLOUDS-1466 > Project: jclouds > Issue Type: Bug > Components: jclouds-compute >Affects Versions: 2.1.1 >Reporter: Simone >Priority: Minor > Labels: azurecompute-arm > > I'm using jclouds v 2.1.1 and ComputeService::listNodes is not working on > azurecompute-arm -- This message was sent by Atlassian JIRA (v7.6.3#76005)
Re: [jclouds/jclouds-site] Fix events and CI links (#222)
lgtm -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-site/pull/222#issuecomment-439082717
Re: [jclouds/jclouds] Improve Jetty installation for live tests (#1230)
@andreaturli pushed 1 commit. 03f1781 downgrade jetty to 9.2.x as it runs on java7 -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds/pull/1230/files/bec0de59ff8e539608778b44432e6db291cc06ba..03f178150c1a84035cd2143ca1f1c2146a473a20
Re: [jclouds/jclouds] Improve Jetty installation for live tests (#1230)
@andreaturli pushed 1 commit. bec0de5 - remove SslSelectChannelConnector import -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds/pull/1230/files/2b2688e2080f5443d88915c83f840178871d546e..bec0de59ff8e539608778b44432e6db291cc06ba
Re: [jclouds/jclouds] Improve Jetty installation for live tests (#1230)
thanks @nacx I've bumped the jetty version to the latest `9.4.12.v20180830` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1230#issuecomment-435129000
Re: [jclouds/jclouds] Improve Jetty installation for live tests (#1230)
@andreaturli pushed 1 commit. 2b2688e -bump jetty version to fix security vulnerability -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds/pull/1230/files/86630f4dd6dcf2466615ca456b892d4bf1ad9097..2b2688e2080f5443d88915c83f840178871d546e
Re: [jclouds/jclouds-examples] Dimension Data - Added cleanServer call to NetworkDomainTearDown (#95)
lgtm -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-examples/pull/95#issuecomment-431398075
Re: [jclouds/jclouds] CVE-2015-5262: Upgrade Apache Http driver to 4.3.6 (#1247)
lgmt -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1247#issuecomment-431094288
Re: [jclouds/jclouds] JCLOUDS-1460: Add support for aws ec2 t3 instance types (#1244)
thanks @pimuzzo for the clarification Feel free to close this yourself, and maybe help with the review of #1245, as you are waiting for (some) same features contained there! Thanks! -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1244#issuecomment-430600791
Re: [jclouds/jclouds] JCLOUDS-1460: Add support for aws ec2 t3 instance types (#1244)
I'm confused guys, does #1245 supersede this one? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1244#issuecomment-430414297
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
Closed #443. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#event-1840127835
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
merger at [master](https://git1-us-west.apache.org/repos/asf?p=jclouds-labs.git;a=commit;h=a5dbf0065d8fa8cabcaf020b7c10fe2f7ccf8d6a) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#issuecomment-420508064
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
thanks @nacx, merging it now -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#issuecomment-420501158
Re: [jclouds/jclouds-labs] JCLOUDS-1445 1&1 Recovery images (#444)
andreaturli approved this pull request. lgtm only a minor comment, thanks @alibazlamit >this.api = oneandoneapi; + this.waitServerUntilDeleted = waitServerUntilDeleted; [minor] `serverDeletePredicate` instead of `waitServerUntilDeleted` ? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/444#pullrequestreview-151586537
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
@andreaturli pushed 1 commit. 0673eb8 fix NPE in InstanceToNodeMetadata -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443/files/c7d38ec7172a488d785365e9d8d47953687fc3ef..0673eb83f306f8b4aa9463fa0bf4d34941280aa7
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
Re-run the live tests, slightly better Tests run: 55, Failures: 9, Errors: 0, Skipped: 6 `SshKeyPairApiLiveTest.testImport` - I'm afraid the API is broken `ECSComputeServiceLiveTest.testCorrectAuthException` returns `ResourceNotFoundException` instead of `AuthorizationException` not entirely sure how to treat that. the others are mostly related to java installation on centos7 failure. ``` Results : Failed tests: SshKeyPairApiLiveTest.testImport:58 » IllegalArgument {"RequestId":"4C152F57-E... ECSComputeServiceLiveTest.testCorrectAuthException » Test Method BaseComputeS... ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testCreateAndRunAService:747 » NoSuchElement ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testGet:553 » NoSuchElement ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testListSizes:888->BaseComputeServiceLiveTest.checkVolumes:893 {id=ecs.sn1.medium, providerId=ecs.sn1.medium, name=ecs.sn1.medium, processors=[{cores=2.0, speed=2.0}], ram=4096, hypervisor=none, supportsImage=Predicates.alwaysTrue()} ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testOptionToNotBlock:873 » Authorization ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testAScriptExecutionAfterBootWithBasicTemplate:249->BaseComputeServiceLiveTest.checkNodes:532->BaseComputeServiceLiveTest.sshPing:928->BaseComputeServiceLiveTest.doCheckJavaIsInstalledViaSsh:949 {output=bash: java: command not found , error=, exitStatus=127} ``` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#issuecomment-416260449
Re: [jclouds/jclouds] JCLOUDS-1339: Support launching an x1 EC2 instance (#1235)
andreaturli commented on this pull request. > @@ -290,6 +290,19 @@ private EC2HardwareBuilder hs1() { virtualizationTypes(VirtualizationType.HVM, VirtualizationType.PARAVIRTUAL); return this; } + + private EC2HardwareBuilder x1() { + virtualizationTypes(VirtualizationType.HVM); + + // TODO X1 is not deprecated, but it requires that you are using a VPC + // until we have a way for hardware instances to be filtered based on network + // we do NOT want X1 selected automatically. + // You get: org.jclouds.aws.AWSResponseException: request POST https://ec2.eu-west-1.amazonaws.com/ HTTP/1.1 failed with code 400, error: AWSError{requestId='2300b99e-ddc0-42ab-b1ed-9d628a161be4', requestToken='null', code='VPCResourceNotSpecified', message='The specified instance type can only be used in a VPC. A subnet ID or network interface ID is required to carry out the request.', context='{Response=, Errors=}'} + // A user can explicitly request a x1 if they are also setting up a VPC. + deprecated(); I think it makes sense. I'll merge it asap -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1235#discussion_r212389076
Re: [jclouds/jclouds] JCLOUDS-1339: Support launching an x1 EC2 instance (#1235)
andreaturli commented on this pull request. > @@ -290,6 +290,19 @@ private EC2HardwareBuilder hs1() { virtualizationTypes(VirtualizationType.HVM, VirtualizationType.PARAVIRTUAL); return this; } + + private EC2HardwareBuilder x1() { + virtualizationTypes(VirtualizationType.HVM); + + // TODO X1 is not deprecated, but it requires that you are using a VPC + // until we have a way for hardware instances to be filtered based on network + // we do NOT want X1 selected automatically. + // You get: org.jclouds.aws.AWSResponseException: request POST https://ec2.eu-west-1.amazonaws.com/ HTTP/1.1 failed with code 400, error: AWSError{requestId='2300b99e-ddc0-42ab-b1ed-9d628a161be4', requestToken='null', code='VPCResourceNotSpecified', message='The specified instance type can only be used in a VPC. A subnet ID or network interface ID is required to carry out the request.', context='{Response=, Errors=}'} + // A user can explicitly request a x1 if they are also setting up a VPC. + deprecated(); Thanks @lemmy @nacx any thoughts on this? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1235#discussion_r212064403
Re: [jclouds/jclouds-labs] JCLOUDS-1386 1&1 Baremetal servers (#431)
andreaturli requested changes on this pull request. @alibazlamit I've added some more comments but I could not finish up the review as the code is becoming too complicated to be reviewed. As I told you other times it would be much easier to add small chunks of code in small PRs. For example you could focus on a PR that adds `RecoveryImageApi` with Mock and Live Tests only (+ domain objects needed) Then we can focus on the baremetal feature itself as it requires a huge number of changes! Does it sound like a plan? Thanks again > @@ -253,7 +253,7 @@ public static ApplianceType fromValue(String v) { } public enum OSImageType { - Standard, Minimal, Personal, ISO_OS, ISO_TOOL, NULL, UNRECOGNIZED; + STANDARD, MINIMAL, Personal, ISO_OS, ISO_TOOL, NULL, UNRECOGNIZED; please make it all capital > @@ -283,4 +283,22 @@ public String toString() { return value; } } + + public enum ServerType { + cloud, baremetal, UNRECOGNIZED; + + public static ServerType fromValue(String v) { + return Enums.getIfPresent(ServerType.class, v).or(UNRECOGNIZED); + } + + } + + public enum ServerTypeCompatibility { + vps, cloud, baremetal, UNRECOGNIZED; upper case? > @@ -283,4 +283,22 @@ public String toString() { return value; } } + + public enum ServerType { + cloud, baremetal, UNRECOGNIZED; why not upper case? > @@ -179,9 +179,46 @@ return new NodeAndInitialCredentials(updateServer, updateServer.id(), serverCredentials); } + private ServerAppliance findWorkingImage(String imageId, Types.ServerTypeCompatibility serverType) { why this name? it seems that it tries to find a `ServerAppliance`, doesn't it? > -//check if the bootable device has enough size to run the > appliance(image). -float minHddSize = volume.getSize(); -if (volume.isBootDevice()) { - SingleServerAppliance appliance = api.serverApplianceApi().get(image.getId()); - if (appliance.minHddSize() > volume.getSize()) { - minHddSize = appliance.minHddSize(); - } -} -Hdd.CreateHdd hdd = Hdd.CreateHdd.create(minHddSize, volume.isBootDevice()); -hdds.add(hdd); - } catch (Exception ex) { -throw Throwables.propagate(ex); - + String imageId = image.getId(); + Hardware hardwareModel = generateHardwareRequest.isFlavor(hardware.getId()); + boolean isBaremetal = hardware.getName() == null ? false : hardware.getName().contains(baremetalModelsKey); wouldn't be better to introduce a custom `TemplateOptions` where you can pass in `bareMetal` boolean parameter? see https://github.com/jclouds/jclouds/blob/master/providers/digitalocean2/src/main/java/org/jclouds/digitalocean2/compute/options/DigitalOcean2TemplateOptions.java#L38 for an example > - SingleServerAppliance appliance = > api.serverApplianceApi().get(image.getId()); - if (appliance.minHddSize() > volume.getSize()) { - minHddSize = appliance.minHddSize(); - } -} -Hdd.CreateHdd hdd = Hdd.CreateHdd.create(minHddSize, volume.isBootDevice()); -hdds.add(hdd); - } catch (Exception ex) { -throw Throwables.propagate(ex); - + String imageId = image.getId(); + Hardware hardwareModel = generateHardwareRequest.isFlavor(hardware.getId()); + boolean isBaremetal = hardware.getName() == null ? false : hardware.getName().contains(baremetalModelsKey); + ServerAppliance workingImage; + + //choose the correct image based on the server type baremetal or cloud move this business logic into its own method > } } - // provision server - Server server = null; - Double cores = ComputeServiceUtils.getCores(hardware); - Double ram = (double) hardware.getRam(); - if (ram < 1024) { - ram = 0.5; - } else { - ram = ram / 1024; + //configuring Firewall rules + Map portsRange = getPortRangesFromList(inboundPorts); all the reasonings for the firewalls / inbound ports shouldn't probably happen in the adapter: firewalls are created once and attached to all the nodes of a group. See `CreateResourcesThenCreateNodes` as a reference at https://github.com/jclouds/jclouds/blob/master/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/strategy/CreateResourcesThenCreateNodes.java#L138 > - ram = ram / 1024; + //configuring Firewall rules + Map portsRange = getPortRangesFromList(inboundPorts); + List rules = new ArrayList(); + + for (Map.Entry range : portsRange.entrySet()) { + FirewallPolicy.Rule.CreatePayload rule = FirewallPolicy.Rule.CreatePayload.builder() + .portFrom(range.getKey()) + .portTo(range.getValue()) +
Re: [jclouds/jclouds-labs] JCLOUDS-1386 1&1 Baremetal servers (#431)
andreaturli commented on this pull request. > @Inject OneandoneComputeServiceAdapter(OneAndOneApi api, CleanupResources cleanupResources, + GenerateHardwareRequest generateHardwareRequest, @Named(POLL_PREDICATE_SERVER) Predicate waitServerUntilAvailable, PasswordGenerator.Config passwordGenerator) { `PasswordGenerator.Config passwordGenerator` is not used, remove it -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/431#discussion_r212021489
Re: [jclouds/jclouds] [JCLOUDS-1374]This is the first commit of Softlayer LoadBalancer API (#1176)
hi @swaqos any update on that? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1176#issuecomment-415091546
Re: [jclouds/jclouds] Improve Jetty installation for live tests (#1230)
rebuild please -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1230#issuecomment-415091039
Re: [jclouds/jclouds] [JCLOUDS-1443] - Fix resolution uri (#1234)
@gaul do you think it is good to be merged now? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1234#issuecomment-415090751
Re: [jclouds/jclouds] JCLOUDS-1339: Support launching an x1 EC2 instance (#1235)
thanks @lemmy for your contribution! only a minor comment from my side otherwise looks sensible. This manual process is really tedious, thanks for helping us out! I wish AWS will offer a simple instanceTypes API at some point! -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1235#issuecomment-415090459
Re: [jclouds/jclouds] JCLOUDS-1339: Support launching an x1 EC2 instance (#1235)
andreaturli commented on this pull request. > @@ -290,6 +290,19 @@ private EC2HardwareBuilder hs1() { virtualizationTypes(VirtualizationType.HVM, VirtualizationType.PARAVIRTUAL); return this; } + + private EC2HardwareBuilder x1() { + virtualizationTypes(VirtualizationType.HVM); + + // TODO X1 is not deprecated, but it requires that you are using a VPC + // until we have a way for hardware instances to be filtered based on network + // we do NOT want X1 selected automatically. + // You get: org.jclouds.aws.AWSResponseException: request POST https://ec2.eu-west-1.amazonaws.com/ HTTP/1.1 failed with code 400, error: AWSError{requestId='2300b99e-ddc0-42ab-b1ed-9d628a161be4', requestToken='null', code='VPCResourceNotSpecified', message='The specified instance type can only be used in a VPC. A subnet ID or network interface ID is required to carry out the request.', context='{Response=, Errors=}'} + // A user can explicitly request a x1 if they are also setting up a VPC. + deprecated(); [minor] do you think it is still a valid comment? Look quite unusual to not deploy on a VPC these days, is it still important to filter those instance types -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1235#pullrequestreview-148559738
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
here's the live tests result ``` Results : Failed tests: SshKeyPairApiLiveTest.testImport:58 » IllegalArgument {"RequestId":"4084B85E-D... ECSComputeServiceLiveTest.testCorrectAuthException » Test Method BaseComputeS... ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testCreateAndRunAService:747 » NoSuchElement ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testGet:553 » NoSuchElement ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testImageById:211 expected [{id=eu-central-1/centos_7_04_64_20G_alibase_20180419.vhd, providerId=centos_7_04_64_20G_alibase_20180419.vhd, name=centos_7_04_64_20G_alibase_20180419.vhd, location={scope=REGION, id=eu-central-1, description=欧洲中部 1 (法兰克福), parent=alibaba-ecs}, os={family=centos, name=CentOS 7.4 64位, version=7.4, description=, is64Bit=true}, description=, status=AVAILABLE, loginUser=root}] but found [null] ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testListSizes:888->BaseComputeServiceLiveTest.checkVolumes:893 {id=ecs.sn1.medium, providerId=ecs.sn1.medium, name=ecs.sn1.medium, processors=[{cores=2.0, speed=2.0}], ram=4096, hypervisor=none, supportsImage=Predicates.alwaysTrue()} ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testOptionToNotBlock:866 » RunNodes ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testWeCanCancelTasks:282 » RunNodes ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testAScriptExecutionAfterBootWithBasicTemplate:227 » RunNodes ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testConcurrentUseOfComputeServiceToCreateNodes:498 » Execution ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testCreateTwoNodesWithOneSpecifiedName:383 » RunNodes ECSComputeServiceLiveTest>BaseComputeServiceLiveTest.testCreateAnotherNodeWithANewContextToEnsureSharedMemIsntRequired:435 » RunNodes Tests run: 55, Failures: 12, Errors: 0, Skipped: 7 ``` `SshKeyPairApiLiveTest` is a quite weird as by the doc it should work I'll concentrate on `ECSComputeServiceLiveTest` failures of `{testGet, testImageById, testListSizes}` as they should be fine. `testCreateAndRunAService` fails because of jetty on centos7 issue -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#issuecomment-415086300
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
sorry again as this PR is becoming huge. @nacx I think I've addressed all of your comments now and I've also simplified the RetryHandler for 4xx errors I'm running the live tests to see the result, some of them are expected to fail though - particularly from `ECSComputeServiceLiveTest`. I'll keep you posted Thanks again for your help -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#issuecomment-415059572
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > +import org.jclouds.http.HttpRetryHandler; +import org.jclouds.http.HttpUtils; +import org.jclouds.http.annotation.ClientError; +import org.jclouds.http.handlers.BackoffLimitedRetryHandler; +import org.jclouds.json.Json; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.Set; + +import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream; + +/** + * Handles Retryable responses with error codes in the 4xx range + */ +public class ECSErrorRetryHandler implements HttpRetryHandler { @nacx I think this implementation reflects better your suggestion, but please advice if it is not what you meant! thanks -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#pullrequestreview-148517914
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + this.instanceSuspendedPredicate = instanceSuspendedPredicate; + this.regionIds = regionIds; + this.cleanupResources = cleanupResources; + } + + @Override + public NodeAndInitialCredentials createNodeWithGroupEncodedIntoName(String group, String name, Template template) { + String instanceType = template.getHardware().getId(); + String regionId = template.getLocation().getId(); + String imageId = template.getImage().getId(); + + ECSServiceTemplateOptions templateOptions = template.getOptions().as(ECSServiceTemplateOptions.class); + + String keyPairName = templateOptions.getKeyPairName(); + String securityGroupId = Iterables.getOnlyElement(templateOptions.getGroups()); + String vSwitchId = templateOptions.getVSwitchId(); I think I've added the necessary code to support this design: vpcApi vSwitchApi and I've modified the `CreateResourcesThenCreateNodes` accordingly -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r211981725
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + + public void testList() { + final AtomicInteger found = new AtomicInteger(0); + assertTrue(Iterables.all(api().list(Regions.EU_CENTRAL_1.getName()).concat(), new Predicate() { + @Override + public boolean apply(VSwitch input) { +found.incrementAndGet(); +return !isNullOrEmpty(input.id()); + } + }), "All vSwitches must have at least the 'id' field populated"); + assertTrue(found.get() > 0, "Expected some vSwitch to be returned"); + } + + private VSwitchApi api() { + return api.vSwitchApi(); + } added missing -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r211981309
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + + public void testList() { + final AtomicInteger found = new AtomicInteger(0); + assertTrue(Iterables.all(api().list(Regions.EU_CENTRAL_1.getName()).concat(), new Predicate() { + @Override + public boolean apply(VPC input) { +found.incrementAndGet(); +return !isNullOrEmpty(input.id()); + } + }), "All vpcs must have at least the 'id' field populated"); + assertTrue(found.get() > 0, "Expected some vpc to be returned"); + } + + private VPCApi api() { + return api.vpcApi(); + } added missing -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r211981335
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + * 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.aliyun.ecs.domain; + +import com.google.common.base.Enums; +import com.google.common.base.Joiner; +import com.google.common.base.Optional; + +import static com.google.common.base.Preconditions.checkArgument; + +/** + * The type of the ECS resource. All values must be lowercase. done -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r211981107
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + + final Image image = imageInRegionToImage.apply(ImageInRegion.create(Regions.EU_CENTRAL_1.getName(), ecsImage)); + assertEquals(ecsImage.id(), image.getProviderId()); + assertEquals(ecsImage.name(), image.getName()); + assertEquals(Image.Status.AVAILABLE, image.getStatus()); + final org.jclouds.compute.domain.OperatingSystem operatingSystem = image.getOperatingSystem(); + + assertEquals(ecsImage.osName(), operatingSystem.getName()); + assertEquals(ecsImage.description(), operatingSystem.getDescription()); + assertTrue(operatingSystem.is64Bit()); + assertEquals(region, image.getLocation()); + } + + Date parseDate(final String dateString) { + return DatatypeConverter.parseDateTime(dateString).getTime(); + } done -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r211980875
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
@nacx it is a wip, so please don't bother to review it yet. I'll ping when I think it's ready for your review, ok? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#issuecomment-414683491
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
@andreaturli pushed 2 commits. 2d991e1 wip 88d83f3 more comments addressed -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443/files/801266bac92ae8d6c54cdec540b1860b95f8cb94..88d83f336aefd7a8013dac58f79e5b9ea4ec27c9
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > +// public String apply(Map.Entry input) { +//return String.format(PORT_RANGE_FORMAT, input.getKey(), input.getValue()); +// } +// })); +// +// for (SecurityGroup securityGroup : api.securityGroupApi().list(regionId).concat()) { +// List permissions = api.securityGroupApi().get(regionId, securityGroup.id()); +// if (permissions.size() == portRangesAsString.size()) { +//for (Permission permission : permissions) { +// if (permission.ipProtocol() == IpProtocol.TCP && permission.sourceCidrIp().equals(INTERNET)) { +// portRangesAsString.remove(permission.portRange()); +// } +//} +//if (portRangesAsString.isEmpty()) return Optional.of(securityGroup); +// } +// } sorry removed -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r211587632
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > public class BaseECSComputeServiceApiLiveTest extends > BaseApiLiveTest { + protected static final String TEST_REGION = Regions.EU_CENTRAL_1.getName(); ok done -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r211107120
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > @@ -23,6 +23,10 @@ @AutoValue public abstract class Tag { + public static final String DEFAULT_OWNER_KEY = "owner"; + public static final String DEFAULT_OWNER_VALUE = "jclouds"; + public static final String GROUP = "group"; not sure we need that, as I'm adding the vswitchId tag using this code ``` Map tags = ComputeServiceUtils.metadataAndTagsAsValuesOfEmptyString(templateOptions); tags = new ImmutableMap.Builder() .putAll(tags) .put(vSwitchId, "") .build(); ``` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r211107039
Re: [jclouds/jclouds-site] draft release notes 2.1.1 (#217)
andreaturli commented on this pull request. > +* [JCLOUDS-1389] - Multipart upload to Google cloud storage failing with 400 > bad request +* [JCLOUDS-1391] - Headers must be sorted by lowercase when calculating signature +* [JCLOUDS-1392] - When fetching blob metadata with details all folders are removed from response +* [JCLOUDS-1400] - GCS's presigned url requires blank Content-Type +* [JCLOUDS-1401] - S3 SignatureDoesNotMatch when listing keys using prefix with ampersand +* [JCLOUDS-1405] - Dimension Data Live Tests Broken - Domain classes for Server and Image with List nics incorrect +* [JCLOUDS-1410] - SoftLayer cannot provision with private image +* [JCLOUDS-1422] - LocalBlobStore.list ignores recursive flag when prefix set +* [JCLOUDS-1427] - NPE when deserializing Elastic IPs that have tags +* [JCLOUDS-1433] - IllegalArgumentException from Strings2.replaceTokens + +The complete list of fixed issues and improvements can be found [here](https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12314430=12342884). + +## Known Issues + +There are a number of open JIRA issues related to OpenStack endpoint and API version support: [JCLOUDS-114](https://issues.apache.org/jira/browse/JCLOUDS-114), [JCLOUDS-773](https://issues.apache.org/jira/browse/JCLOUDS-773) and [JCLOUDS-1197](https://issues.apache.org/jira/browse/JCLOUDS-1197). In particular, jclouds does not currently support OpenStack Keystone v3; the community is currently [actively working on that](https://s.apache.org/OSbY). thanks @demobox this is clearly a bad copy and paste from a previous release note -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-site/pull/217#discussion_r209258541
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + + public abstract String description(); + + public abstract String regionId(); + + public abstract String status(); + + public abstract Map> userCidrs(); + + public abstract String vRouterId(); + + public abstract Map> vSwitchIds(); + + public abstract String id(); + + public abstract String name(); done -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r209219842
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + checkTagsInNodeEquals(node, tags); + + getAnonymousLogger().info( + format("<< available node(%s) os(%s) in %ss", node.getId(), node.getOperatingSystem(), createSeconds)); + + watch.reset().start(); + + client.runScriptOnNode(nodeId, AdminAccess.builder().adminUsername("web").build(), nameTask("admin-web")); + + long configureSeconds = watch.elapsed(TimeUnit.SECONDS); + + getAnonymousLogger().info( + format( + "<< configured node(%s) in %ss", + nodeId, + configureSeconds)); Ill remove the override as I think we can accept to have this test broken until we fix the BaseComputeServiceLiveTest -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r209217688
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + + public abstract Date creationTime(); + + public abstract String description(); + + public abstract String zoneId(); + + public abstract String status(); + + public abstract int availableIpAddressCount(); + + public abstract String vpcId(); + + public abstract String id(); + + public abstract String name(); ok -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r209217408
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + * 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.aliyun.ecs.domain; + +import com.google.auto.value.AutoValue; + +@AutoValue +public abstract class UserCidr { + + UserCidr() {} cannot get from API nor from doc -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r209216400
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > +import org.jclouds.rest.annotations.RequestFilters; +import org.jclouds.rest.annotations.ResponseParser; +import org.jclouds.rest.annotations.Transform; + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Singleton; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import java.beans.ConstructorProperties; +import java.util.List; +import java.util.Map; + thanks @danielestevez added the URL for that -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r209215893
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
@andreaturli pushed 1 commit. 801266b addressing more comments -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443/files/3205bbfc559eeeda59f2f7994f1aa179d16057e0..801266bac92ae8d6c54cdec540b1860b95f8cb94
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
@andreaturli pushed 1 commit. b2ce3b5 address some comments -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443/files/b79a887eb460662edb19201977ae961f208dff88..b2ce3b5056c0330d747f04e85dfa815685422e4d
[jclouds/jclouds-site] draft release notes 2.1.1 (#217)
You can view, comment on, or merge this pull request online at: https://github.com/jclouds/jclouds-site/pull/217 -- Commit Summary -- * draft release notes 2.1.1 -- File Changes -- M _config.yml (4) M _includes/navbar.html (1) M doap_jclouds.rdf (7) A releasenotes/2.1.1.md (69) M releasenotes/index.md (1) -- Patch Links -- https://github.com/jclouds/jclouds-site/pull/217.patch https://github.com/jclouds/jclouds-site/pull/217.diff -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-site/pull/217
[jira] [Commented] (JCLOUDS-1437) Rules array inside network security groups is always emtpy
[ https://issues.apache.org/jira/browse/JCLOUDS-1437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16574692#comment-16574692 ] Andrea Turli commented on JCLOUDS-1437: --- cool, let us know how it goes > Rules array inside network security groups is always emtpy > -- > > Key: JCLOUDS-1437 > URL: https://issues.apache.org/jira/browse/JCLOUDS-1437 > Project: jclouds > Issue Type: Bug > Components: jclouds-labs >Affects Versions: 2.1.0 >Reporter: Simone >Priority: Major > Labels: azurecompute > > Hi, > I am using: > {code:java} > >org.apache.jclouds.labs >azurecompute >2.1.0 > > {code} > > With the following code I have the rules array inside networkSecurityGroup > always empty: > {code:java} > AzureComputeApi client = builder.buildApi( AzureComputeApi.class ); > NetworkSecurityGroupApi networkClient = client.getNetworkSecurityGroupApi(); > NetworkSecurityGroup networkSecurityGroup = networkClient.get( > defaultSecurityGroupName ); > {code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (JCLOUDS-1437) Rules array inside network security groups is always emtpy
[ https://issues.apache.org/jira/browse/JCLOUDS-1437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16574681#comment-16574681 ] Andrea Turli commented on JCLOUDS-1437: --- similar situation as JCLOUDS-1438, please let us know > Rules array inside network security groups is always emtpy > -- > > Key: JCLOUDS-1437 > URL: https://issues.apache.org/jira/browse/JCLOUDS-1437 > Project: jclouds > Issue Type: Bug > Components: jclouds-labs >Affects Versions: 2.1.0 >Reporter: Simone >Priority: Major > Labels: azurecompute > > Hi, > I am using: > {code:java} > >org.apache.jclouds.labs >azurecompute >2.1.0 > > {code} > > With the following code I have the rules array inside networkSecurityGroup > always empty: > {code:java} > AzureComputeApi client = builder.buildApi( AzureComputeApi.class ); > NetworkSecurityGroupApi networkClient = client.getNetworkSecurityGroupApi(); > NetworkSecurityGroup networkSecurityGroup = networkClient.get( > defaultSecurityGroupName ); > {code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (JCLOUDS-1438) Can't attach a network security group to a VM
[ https://issues.apache.org/jira/browse/JCLOUDS-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16574679#comment-16574679 ] Andrea Turli commented on JCLOUDS-1438: --- [~pimuzzo] thanks for reporting this issue. Just to understand a bit better, `azurecompute` is a provider modelled on deprecated Azure API. Azure Compute provider is not actively developed because Microsoft recommends to use Azure Resource Mgmt API now that's why jclouds community has focused on azurecompute-arm provider, now promoted to jclouds/jclouds repo Said that, we are happy to help with your issue in case azurecompute old API are an strong requirement for your use-case. Please let us know. > Can't attach a network security group to a VM > - > > Key: JCLOUDS-1438 > URL: https://issues.apache.org/jira/browse/JCLOUDS-1438 > Project: jclouds > Issue Type: Bug > Components: jclouds-labs >Affects Versions: 2.1.0 >Reporter: Simone >Priority: Blocker > Labels: azurecompute > > Hi, > I am using: > {code:java} > >org.apache.jclouds.labs >azurecompute >2.1.0 > > {code} > > With the following code I can't attach a network security group to a virtual > machine: > {code:java} > AzureComputeTemplateOptions templateOptions = new > AzureComputeTemplateOptions() > .networkSecurityGroupName( defaultSecurityGroupName ); > {code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + checkTagsInNodeEquals(node, tags); + + getAnonymousLogger().info( + format("<< available node(%s) os(%s) in %ss", node.getId(), node.getOperatingSystem(), createSeconds)); + + watch.reset().start(); + + client.runScriptOnNode(nodeId, AdminAccess.builder().adminUsername("web").build(), nameTask("admin-web")); + + long configureSeconds = watch.elapsed(TimeUnit.SECONDS); + + getAnonymousLogger().info( + format( + "<< configured node(%s) in %ss", + nodeId, + configureSeconds)); I actually like the idea of using `python -m SimpleHttpServer` instead of installing `java` and `jetty` as it takes much longer If we agree on this I think i can open a PR for jclouds/jclouds and change the ComputeServiceLiveTest for all of the providers -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r208873439
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > } catch (Exception ex) { logger.warn(ex, "Error cleaning up resources for node %s", deadNode); } + + List securityGroups = cleanupResources.findOrphanedSecurityGroups(regionAndId.regionId(), deadNode.getGroup()); + for (SecurityGroup securityGroup : securityGroups) { +logger.debug(">> destroying security group %s ...", securityGroup.id()); +if (cleanupResources.cleanupSecurityGroupIfOrphaned(regionAndId.regionId(), securityGroup.id())) { + logger.debug(">> security group: (%s) has been deleted.", securityGroup.id()); +} else { + logger.warn(">> security group: (%s) has not been deleted.", securityGroup.id()); +} + } + + // FIXME not sure it is correct to always delete vSwitch and VPC flaky, indeed! >From the doc: - costs: I think it's usage is for free - Maximum number of VPCs per region: 10 (Submit a ticket to apply for more quota) - other concerns: although fast, creating/destroying VPC adds a delay, but not crucial -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r208855282
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > } catch (Exception ex) { logger.warn(ex, "Error cleaning up resources for node %s", deadNode); } + + List securityGroups = cleanupResources.findOrphanedSecurityGroups(regionAndId.regionId(), deadNode.getGroup()); + for (SecurityGroup securityGroup : securityGroups) { +logger.debug(">> destroying security group %s ...", securityGroup.id()); +if (cleanupResources.cleanupSecurityGroupIfOrphaned(regionAndId.regionId(), securityGroup.id())) { + logger.debug(">> security group: (%s) has been deleted.", securityGroup.id()); +} else { + logger.warn(">> security group: (%s) has not been deleted.", securityGroup.id()); +} + } + + // FIXME not sure it is correct to always delete vSwitch and VPC +1 I was thinking about giving the opportunity to decide whether to keep a VPC created by jclouds or delete it for every deployment. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r208738195
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > } catch (Exception ex) { logger.warn(ex, "Error cleaning up resources for node %s", deadNode); } + + List securityGroups = cleanupResources.findOrphanedSecurityGroups(regionAndId.regionId(), deadNode.getGroup()); + for (SecurityGroup securityGroup : securityGroups) { +logger.debug(">> destroying security group %s ...", securityGroup.id()); +if (cleanupResources.cleanupSecurityGroupIfOrphaned(regionAndId.regionId(), securityGroup.id())) { + logger.debug(">> security group: (%s) has been deleted.", securityGroup.id()); +} else { + logger.warn(">> security group: (%s) has not been deleted.", securityGroup.id()); +} + } + + // FIXME not sure it is correct to always delete vSwitch and VPC thinking about it more, regardless of the tags, I think the question is whether is right to destroy a VPC every time jclouds deletes a group of nodes or not. I honestly don't know the answer as I can see value in both cases, so maybe an extra property configurable by the user? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r208719830
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > } catch (Exception ex) { logger.warn(ex, "Error cleaning up resources for node %s", deadNode); } + + List securityGroups = cleanupResources.findOrphanedSecurityGroups(regionAndId.regionId(), deadNode.getGroup()); + for (SecurityGroup securityGroup : securityGroups) { +logger.debug(">> destroying security group %s ...", securityGroup.id()); +if (cleanupResources.cleanupSecurityGroupIfOrphaned(regionAndId.regionId(), securityGroup.id())) { + logger.debug(">> security group: (%s) has been deleted.", securityGroup.id()); +} else { + logger.warn(">> security group: (%s) has not been deleted.", securityGroup.id()); +} + } + + // FIXME not sure it is correct to always delete vSwitch and VPC Good point @danielestevez unfortunately tagApi don't work for VPC or VSwitch, only instances, images and few others. Trying to use the `description` although super ugly -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r208706820
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > } catch (Exception ex) { logger.warn(ex, "Error cleaning up resources for node %s", deadNode); } + + List securityGroups = cleanupResources.findOrphanedSecurityGroups(regionAndId.regionId(), deadNode.getGroup()); + for (SecurityGroup securityGroup : securityGroups) { +logger.debug(">> destroying security group %s ...", securityGroup.id()); +if (cleanupResources.cleanupSecurityGroupIfOrphaned(regionAndId.regionId(), securityGroup.id())) { + logger.debug(">> security group: (%s) has been deleted.", securityGroup.id()); +} else { + logger.warn(">> security group: (%s) has not been deleted.", securityGroup.id()); +} + } + + // FIXME not sure it is correct to always delete vSwitch and VPC @nacx wdyt? I'm not completely sure about this default behaviour -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#pullrequestreview-144485695
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
@andreaturli pushed 4 commits. 701f36e add pagination to instanceStatus api 9dc04fb add network apis ebd1642 improve CreateResourcesThenCreateNodes b79a887 wip -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443/files/88d085280a99fcc7bb799721b873661fbb3feaeb..b79a887eb460662edb19201977ae961f208dff88
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > @@ -54,6 +46,7 @@ protected Properties setupProperties() { Properties properties = super.setupProperties(); vpcId = setIfTestSystemPropertyPresent(properties, provider + ".vpcId"); vSwitchId = setIfTestSystemPropertyPresent(properties, provider + ".vSwitchId"); + group = "jclouds"; // otherwise jclouds will use provider name as group but `aliyun` is a forbidden prefix for tags @nacx as it can't start with `aliyun` shall I use `alibaba-ecs` as id for the provider in the `ECSComputeServiceProviderMetadata` ? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207836467
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > +@AutoValue +public abstract class EipAddress { + + EipAddress() { + } + + @SerializedNames({ "IpAddress", "AllocationId", "InternetChargeType" }) + public static EipAddress create(String ipAddress, String allocationId, String internetChargeType) { + return new AutoValue_EipAddress(ipAddress, allocationId, internetChargeType); + } + + public abstract String ipAddress(); + + public abstract String allocationId(); + + public abstract String internetChargeType(); don't know, they are not well documented -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207833707
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > +// expect(serverApi.getServer(serverId)).andReturn(server); +// } +// +// private void applyWithExpectedErrorMessage(String expectedErrorMessage) { +// try { +// cleanupServer.apply(serverId); +// } catch (IllegalStateException e) { +// assertEquals(expectedErrorMessage, e.getMessage()); +// } +// } +// +// private void networkApiExpectations() { +// expect(api.getNetworkApi()).andReturn(networkApi); +// } +// +//} still working on this, forget to exclude from commit, sorry -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207828836
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > @@ -54,6 +46,7 @@ protected Properties setupProperties() { Properties properties = super.setupProperties(); vpcId = setIfTestSystemPropertyPresent(properties, provider + ".vpcId"); vSwitchId = setIfTestSystemPropertyPresent(properties, provider + ".vSwitchId"); + group = "jclouds"; // otherwise jclouds will use provider name as group but `aliyun` is a forbidden prefix for tags good point, Ill look into it -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207828745
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > +annotations-java5 +RELEASE +compile + + +org.jetbrains +annotations-java5 +RELEASE +compile + + +org.jetbrains +annotations-java5 +RELEASE +compile + where this crap come from? :( -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207828506
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
@andreaturli pushed 1 commit. 88d0852 address comments -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443/files/39fef5305d6cdfb660ecee32244eba7e7f5f68b5..88d085280a99fcc7bb799721b873661fbb3feaeb
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + vSwitchId = setIfTestSystemPropertyPresent(properties, provider + > ".vSwitchId"); + return properties; + } + + @Override + protected TemplateBuilder templateBuilder() { + return super.templateBuilder() + .options(vpcId(vpcId) + .vSwitchId(vSwitchId)); + } + + @Override + protected Template addRunScriptToTemplate(Template template) { + template.getOptions().runScript(Statements.newStatementList( +new Statement[] { AdminAccess.standard(), Statements.exec("sleep 50"), InstallJDK.fromOpenJDK() })); + return template; this was an ugly test, we need to fix `InstallJDK` as it is broken for yum-based OS, IMHO -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207259289
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > @@ -92,4 +94,14 @@ public boolean apply(@Nullable String input) { }), "Cannot starts with " + Iterables.toString(FORBIDDEN_PREFIX)); } + /** +* This is strictly not needed but apparently tags with `-` can create a problem when using API, so I've decided to use +* base64 encoding +* @param value +* @return +*/ + public String encodeTag(String value) { not needed anymore, thx -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207255836
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + + String securityGroupId = null; + if (!options.getGroups().isEmpty()) { + Iterable securityGroupNames = api.securityGroupApi().list(location.getId()).concat().transform(new Function() { +@Override +public String apply(SecurityGroup input) { + return input.name(); +} + }); + for (String securityGroupName : options.getGroups()) { +checkState(Iterables.contains(securityGroupNames, securityGroupName), "Cannot find security group with name " + securityGroupName + ". \nSecurity groups available are: \n" + Iterables.toString(securityGroupNames)); // { + } + } else if (options.getInboundPorts().length > 0) { + String name = namingConvention.create().sharedNameForGroup(group); + SecurityGroupRequest securityGroupRequest = api.securityGroupApi().create(location.getId(), + CreateSecurityGroupOptions.Builder.securityGroupName(name).vpcId(options.getVpcId())); ok for validating them, not entirely sure about create a vSwitch if not available -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207199172
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + } else { +logger.warn(">> security group: (%s) has not been deleted.", securityGroupId); + } + } + + return instanceDeleted; + } + + private List getSecurityGroupIdsUsedByNode(RegionAndId regionAndId) { + List securityGroupIds = Lists.newArrayList(); + PaginatedCollection instances = api.instanceApi().list(regionAndId.regionId(), ListInstancesOptions.Builder.instanceIds(regionAndId.id())); + if (instances.isEmpty()) return securityGroupIds; + + Instance instance = Iterables.get(instances, 0); + if (instance != null && !instance.securityGroupIds().isEmpty()) { + securityGroupIds = instance.securityGroupIds().values().iterator().next(); again it's a list ;) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207136327
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + if (hardware.isPresent()) { + builder.hardware(hardware.get()); + } else { + logger.info(">> hardware with id %s for instance %s was not found. " + + "This might be because the image that was used to create the instance has a new id.", + from.instanceType(), from.instanceId()); + } + + builder.id(RegionAndId.slashEncodeRegionAndId(from.regionId(), from.instanceId())); + builder.providerId(from.instanceId()); + builder.name(from.instanceName()); + builder.hostname(String.format("%s", from.hostname())); + builder.group(groupNamingConvention.extractGroup(from.instanceName())); + builder.status(toPortableStatus.apply(from.status())); + builder.privateAddresses(from.innerIpAddress().entrySet().iterator().next().getValue()); + builder.publicAddresses(from.publicIpAddress().entrySet().iterator().next().getValue()); it's a weird data structure, getValue returns a List! :D -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207135700
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + +import com.google.common.base.MoreObjects; +import com.google.common.base.Objects; +import org.jclouds.compute.options.TemplateOptions; + +import static com.google.common.base.Objects.equal; + +/** + * Custom options for the Alibaba Elastic Compute Service API. + */ +public class ECSServiceTemplateOptions extends TemplateOptions implements Cloneable { + + private String keyPairName = ""; + private String vpcId = ""; + private String vSwitchId = ""; + private String userData = ""; possibly, removing -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207135922
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + private final Supplier> hardwares; + private final Supplier> locations; + private final Function toPortableStatus; + private final GroupNamingConvention groupNamingConvention; + @Resource @Named(ComputeServiceConstants.COMPUTE_LOGGER) protected Logger logger = Logger.NULL; + + @Inject + public InstanceToNodeMetadata(InstanceTypeToHardware instanceTypeToHardware, + Supplier> images, + Supplier> hardwares, + @Memoized Supplier> locations, + Function toPortableStatus, + GroupNamingConvention.Factory groupNamingConvention) { + this.instanceTypeToHardware = instanceTypeToHardware; + this.images = checkNotNull(images, "images cannot be null"); + this.hardwares = checkNotNull(hardwares, "hardwares cannot be null"); ok -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207135462
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + @Override + public boolean apply(@Nullable InstanceType input) { +return contains(instanceTypeIds.build(), input.instanceTypeId()); + } + }).toList(); + + return instanceTypes; + } + + private List getInstanceTypeId(String regionId) { + List instanceTypeIds = Lists.newArrayList(); + for (AvailableZone availableZone : api.instanceApi().listInstanceTypesByAvailableZone(regionId)) { + for (AvailableResource availableResource : availableZone.availableResources().get("AvailableResource")) { +for (SupportedResource supportedResource : availableResource.supportedResources() +.get("SupportedResource")) { + if ("Available".equals(supportedResource.status())) { ok -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207133392
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + transform(listLocations(), new Function() { + @Override + public String apply(Region location) { +return location.id(); + } + })); + + for (String regionId : availableLocationNames) { + instances.addAll(api.instanceApi().list(regionId).concat()); + } + return instances.build(); + } + + @Override + public Iterable listNodesByIds(final Iterable ids) { + return filter(listNodes(), new Predicate() { done -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207133421
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + for (String regionId : availableLocationNames) { + instanceTypeIds.addAll(getInstanceTypeId(regionId)); + } + + List instanceTypes = FluentIterable.from(api.instanceApi().listTypes()) + .filter(new Predicate() { + @Override + public boolean apply(@Nullable InstanceType input) { +return contains(instanceTypeIds.build(), input.instanceTypeId()); + } + }).toList(); + + return instanceTypes; + } + + private List getInstanceTypeId(String regionId) { ok -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207133364
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + + for (String regionId : availableLocationNames) { + images.addAll(api.imageApi().list(regionId).concat()); + } + return images.build(); + } + + @Override + public Image getImage(final String id) { + Optional firstInterestingImage = Iterables.tryFind(listImages(), new Predicate() { + public boolean apply(Image input) { +return input.id().equals(id); + } + }); + if (!firstInterestingImage.isPresent()) { + throw new IllegalStateException("Cannot find image with the required slug " + id); ok -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207133407
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + transform(listLocations(), new Function() { + @Override + public String apply(Region location) { +return location.id(); + } + })); + + for (String regionId : availableLocationNames) { + instanceTypeIds.addAll(getInstanceTypeId(regionId)); + } + + List instanceTypes = FluentIterable.from(api.instanceApi().listTypes()) + .filter(new Predicate() { + @Override + public boolean apply(@Nullable InstanceType input) { +return contains(instanceTypeIds.build(), input.instanceTypeId()); thx -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207133342
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > +} + } + } + return instanceTypeIds; + } + + @Override + public Iterable listImages() { + final ImmutableList.Builder images = ImmutableList.builder(); + final List availableLocationNames = newArrayList( + transform(listLocations(), new Function() { + @Override + public String apply(Region location) { +return location.id(); + } + })); awesome -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207126456
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + + InstanceRequest instanceRequest = api.instanceApi().create(regionId, imageId, securityGroupId, name, instanceType, + CreateInstanceOptions.Builder + .vSwitchId(vSwitchId) + .internetChargeType("PayByTraffic") + .internetMaxBandwidthOut(5) + .instanceChargeType("PostPaid") + .instanceName(name) + .keyPairName(keyPairName) + .tagOptions(tagOptions) + ); + String regionAndInstanceId = RegionAndId.slashEncodeRegionAndId(regionId, instanceRequest.getInstanceId()); + instanceSuspendedPredicate.apply(regionAndInstanceId); + api.instanceApi().allocatePublicIpAddress(regionId, instanceRequest.getInstanceId()); + api.instanceApi().powerOn(instanceRequest.getInstanceId()); + instanceRunningPredicate.apply(regionAndInstanceId); I think we may skip it, thanks -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207117579
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
andreaturli commented on this pull request. > + this.instanceSuspendedPredicate = instanceSuspendedPredicate; + this.regionIds = regionIds; + this.cleanupResources = cleanupResources; + } + + @Override + public NodeAndInitialCredentials createNodeWithGroupEncodedIntoName(String group, String name, Template template) { + String instanceType = template.getHardware().getId(); + String regionId = template.getLocation().getId(); + String imageId = template.getImage().getId(); + + ECSServiceTemplateOptions templateOptions = template.getOptions().as(ECSServiceTemplateOptions.class); + + String keyPairName = templateOptions.getKeyPairName(); + String securityGroupId = Iterables.getOnlyElement(templateOptions.getGroups()); + String vSwitchId = templateOptions.getVSwitchId(); @nacx that's a fair point, but I think the best we can do is to `checkNotNull` vSwitchId. In fact, the automatic creation of a vSwitch requires the creation of a VPC as well, which could be handled as VPC api and vSwitch api are quite straightforward *but* which require a number of details: ZoneId, CidrBlock, VpcId and RegionId of course. Those details are *not* related to the `Template` IMHO but are related to the environment where you want to deploy the VM, so passing the vswitch details in the templateOptions doesn't seem right to me. Conversely, making a lot of assumptions on behalf of the user to create a reasonably sensible `vSwitch` sounds unreliable and potentially not satisfying for the end-user anyway. Notice also that a fresh aliyun account comes with no VPC or vSwitch at all so there's no default value to be used here, unfortunately. wdyt? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207111616
[jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
- add instance API - add compute abstraction You can view, comment on, or merge this pull request online at: https://github.com/jclouds/jclouds-labs/pull/443 -- Commit Summary -- * [JCLOUDS-1430] Aliyun ECS -- File Changes -- A aliyun-ecs/README.md (47) M aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/ECSComputeServiceApi.java (4) M aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/ECSServiceApiMetadata.java (2) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/compute/ECSComputeService.java (105) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/compute/ECSComputeServiceAdapter.java (279) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/compute/config/ECSServiceContextModule.java (156) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/compute/functions/ImageToImage.java (84) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/compute/functions/InstanceStatusToStatus.java (43) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/compute/functions/InstanceToNodeMetadata.java (136) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/compute/functions/InstanceTypeToHardware.java (46) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/compute/functions/RegionToLocation.java (54) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/compute/functions/internal/OperatingSystems.java (51) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/compute/options/ECSServiceTemplateOptions.java (156) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/compute/strategy/CleanupResources.java (129) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/compute/strategy/CreateResourcesThenCreateNodes.java (277) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/AllocatePublicIpAddressRequest.java (59) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/AvailableResource.java (43) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/AvailableZone.java (47) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/DedicatedHostAttribute.java (37) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/EipAddress.java (39) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/Instance.java (178) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/InstanceRequest.java (59) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/InstanceStatus.java (55) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/InstanceType.java (39) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/NetworkInterface.java (41) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/ResourceType.java (40) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/SupportedResource.java (36) M aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/Tag.java (10) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/VpcAttributes.java (48) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/options/CreateInstanceOptions.java (161) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/options/ListInstancesOptions.java (258) M aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/options/TagOptions.java (12) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/domain/regionscoped/RegionAndId.java (58) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/features/InstanceApi.java (209) M aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/features/TagApi.java (7) A aliyun-ecs/src/main/java/org/jclouds/aliyun/ecs/predicates/InstanceStatusPredicate.java (33) A aliyun-ecs/src/test/java/org/jclouds/aliyun/ecs/compute/ECSComputeServiceLiveTest.java (113) A aliyun-ecs/src/test/java/org/jclouds/aliyun/ecs/compute/ECSTemplateBuilderLiveTest.java (53) A aliyun-ecs/src/test/java/org/jclouds/aliyun/ecs/compute/features/InstanceApiLiveTest.java (124) A aliyun-ecs/src/test/java/org/jclouds/aliyun/ecs/compute/features/InstanceApiMockTest.java (69) M aliyun-ecs/src/test/java/org/jclouds/aliyun/ecs/compute/features/SecurityGroupApiLiveTest.java (2) M aliyun-ecs/src/test/java/org/jclouds/aliyun/ecs/compute/features/SshKeyPairApiLiveTest.java (4) M aliyun-ecs/src/test/java/org/jclouds/aliyun/ecs/compute/features/TagApiLiveTest.java (9) A aliyun-ecs/src/test/resources/instanceTypes.json (4281) A aliyun-ecs/src/test/resources/instances-first.json (960) A aliyun-ecs/src/test/resources/instances-last.json (960) -- Patch Links -- https://github.com/jclouds/jclouds-labs/pull/443.patch https://github.com/jclouds/jclouds-labs/pull/443.diff -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/443
Re: [jclouds/jclouds-labs] JCLOUDS-1386 1&1 Baremetal servers (#431)
@alibazlamit I've added a question to help the discussion. Can we start from there? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/431#issuecomment-409595895
Re: [jclouds/jclouds-labs] JCLOUDS-1386 1&1 Baremetal servers (#431)
andreaturli commented on this pull request. > @@ -125,4 +126,28 @@ public boolean apply(Server server) { || server.status().percent() != 0); } } + + @Provides + @Singleton + @Named(POLL_PREDICATE_SERVER_SUSPENDED) @alibazlamit why do we need this `POLL_PREDICATE_SERVER_SUSPENDED` when jclouds has `TIMEOUT_NODE_SUSPENDED` ? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/431#discussion_r206903040
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
merged at [master](http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/a5dbf006) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#issuecomment-409351737
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
Closed #441. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#event-1763661946
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
merging now -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#issuecomment-409340097
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
squashed and rebased. waiting for the builder to merge it. thanks @nacx -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#issuecomment-409311478
Re: [jclouds/jclouds-labs] JCLOUDS-1386 1&1 Baremetal servers (#431)
@alibazlamit I think there are still unaddressed issues. Can you please address them first? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/431#issuecomment-409300125
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
@andreaturli pushed 1 commit. 4547b1b wip -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441/files/f2e09f774d0d5236589bb1d2c075a887f2afaf43..4547b1b80cc47e1cfabac71e8c1747cd075cbc5b
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
@andreaturli pushed 1 commit. f2e09f7 wip -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441/files/03b707362be9d648ab9bdb89a409837f4a7ac748..f2e09f774d0d5236589bb1d2c075a887f2afaf43
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
andreaturli commented on this pull request. > +import com.google.common.collect.Iterables; + +import javax.inject.Singleton; +import java.util.Arrays; + +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + +/** + * Takes an array of string and return a "["s1", "s2", … "sN"]" + */ +@Singleton +public class ArrayToCommaSeparatedString implements Function { + @Override + public String apply(Object input) { + checkArgument(checkNotNull(input, "input") instanceof String[], "This function is only valid for array of Strings!"); Agreed but I think it is because of `@ParamParser` annotation -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#discussion_r206304705
[jira] [Commented] (JCLOUDS-1434) create Ec2 instance failed if security group contains a pace in its name
[ https://issues.apache.org/jira/browse/JCLOUDS-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16550732#comment-16550732 ] Andrea Turli commented on JCLOUDS-1434: --- Thanks Yang for reporting this. Is it possible to specify that kind of name from AWS web console? I think the behaviour is consistent. What do you think? > create Ec2 instance failed if security group contains a pace in its name > - > > Key: JCLOUDS-1434 > URL: https://issues.apache.org/jira/browse/JCLOUDS-1434 > Project: jclouds > Issue Type: Bug >Affects Versions: 2.1.0 >Reporter: Yang Yongsheng >Priority: Major > Attachments: image-2018-07-20-16-25-22-749.png > > > I use the latest Jcloud, 2.1.0, create Ec2 instance with Compute API, but get > error if the security group name has space: > {noformat} > Caused by: java.lang.IllegalArgumentException: Object 'yang test1' doesn't > match dns naming constraints. Reason: Should have lowercase ASCII letters, > numbers, or dashes. > at > org.jclouds.predicates.validators.DnsNameValidator.exception(DnsNameValidator.java:74) > at > org.jclouds.predicates.validators.DnsNameValidator.validate(DnsNameValidator.java:66) > at > org.jclouds.predicates.validators.DnsNameValidator.validate(DnsNameValidator.java:36) > at > org.jclouds.compute.internal.FormatSharedNamesAndAppendUniqueStringToThoseWhichRepeat.checkGroup(FormatSharedNamesAndAppendUniqueStringToThoseWhichRepeat.java:124) > at > org.jclouds.compute.internal.FormatSharedNamesAndAppendUniqueStringToThoseWhichRepeat.sharedNameForGroup(FormatSharedNamesAndAppendUniqueStringToThoseWhichRepeat.java:120) > at > org.jclouds.ec2.compute.strategy.CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions.getSecurityGroupsForTagAndOptions(CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions.java:168) > at > org.jclouds.aws.ec2.compute.strategy.CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions.addSecurityGroups(CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions.java:200) > at > org.jclouds.ec2.compute.strategy.CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions.execute(CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions.java:80) > at > org.jclouds.aws.ec2.compute.strategy.CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions.execute(CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions.java:89) > at > org.jclouds.aws.ec2.compute.strategy.CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions.execute(CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions.java:56) > at > org.jclouds.ec2.compute.strategy.EC2CreateNodesInGroupThenAddToSet.createKeyPairAndSecurityGroupsAsNeededThenRunInstances(EC2CreateNodesInGroupThenAddToSet.java:213) > at > org.jclouds.ec2.compute.strategy.EC2CreateNodesInGroupThenAddToSet.runInstancesAndWarnOnInvisible(EC2CreateNodesInGroupThenAddToSet.java:151) > at > org.jclouds.ec2.compute.strategy.EC2CreateNodesInGroupThenAddToSet.execute(EC2CreateNodesInGroupThenAddToSet.java:132) > at > org.jclouds.compute.internal.BaseComputeService.createNodesInGroup(BaseComputeService.java:215) > at > org.jclouds.ec2.compute.EC2ComputeService.createNodesInGroup(EC2ComputeService.java:151){noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
@nacx I think I've addressed all of your comments except the ones for auto/value as I can't extend a @AutoValue class with a @AutoValue subclass -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#issuecomment-405881586
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
@andreaturli pushed 1 commit. 03b7073 address comments -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441/files/ad4dd9931e0b325f685d274509d99b7123957f46..03b707362be9d648ab9bdb89a409837f4a7ac748
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
andreaturli commented on this pull request. > + } + } + + @Named("tag:add") + @POST + @QueryParams(keys = "Action", values = "AddTags") + @Fallback(Fallbacks.EmptyListOnNotFoundOr404.class) + Request add(@QueryParam("RegionId") String region, @QueryParam("ResourceId") String resourceId, +@QueryParam("ResourceType") String resourceType, +TagOptions tagOptions); + + @Named("tag:remove") + @POST + @QueryParams(keys = "Action", values = "RemoveTags") + @Fallback(Fallbacks.EmptyListOnNotFoundOr404.class) + Request remove(@QueryParam("RegionId") String region, I think so, I'll add a method with optional queryparams to remove one tag only -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#discussion_r203304904
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
andreaturli commented on this pull request. > +return new Function>() { + @Override + public IterableWithMarker apply(Object input) { + String regionId = arg0.get().toString(); + ListTagsOptions listTagsOptions = ListTagsOptions.Builder.paginationOptions(PaginationOptions.class.cast(input)); + return api.tagApi().list(regionId, listTagsOptions); + } +}; + } + } + } + + @Named("tag:add") + @POST + @QueryParams(keys = "Action", values = "AddTags") + @Fallback(Fallbacks.EmptyListOnNotFoundOr404.class) ok -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#discussion_r203304737
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
andreaturli commented on this pull request. > + static class ToPagedIterable extends > Arg0ToPagedIterable { + + private final ECSComputeServiceApi api; + + @Inject + ToPagedIterable(ECSComputeServiceApi api) { +this.api = api; + } + + @Override + protected Function> markerToNextForArg0(final Optional arg0) { +return new Function>() { + @Override + public IterableWithMarker apply(Object input) { + String regionId = arg0.get().toString(); + ListSecurityGroupsOptions listSecurityGroupsOptions = ListSecurityGroupsOptions.Builder.paginationOptions(PaginationOptions.class.cast(input)); ok refactored -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#discussion_r203304329
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
andreaturli commented on this pull request. > + @POST + @QueryParams(keys = "Action", values = "ImportKeyPair") + KeyPair importKeyPair(@QueryParam("RegionId") String region, + @QueryParam("PublicKeyBody") String publicKeyBody, + @QueryParam("KeyPairName") String keyPairName); + + @Named("sshKeyPair:delete") + @POST + @QueryParams(keys = "Action", values = "DeleteKeyPairs") + Request delete(@QueryParam("RegionId") String region); + + @Named("sshKeyPair:delete") + @POST + @QueryParams(keys = "Action", values = "DeleteKeyPairs") + Request delete(@QueryParam("RegionId") String region, DeleteKeyPairOptions deleteOptions); +} you mean `delete`? yes one or more. Have changed it as names are not optionals -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#discussion_r203304248
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
andreaturli commented on this pull request. > + @Named("sshKeyPair:create") + @POST + @QueryParams(keys = "Action", values = "CreateKeyPair") + KeyPairRequest create(@QueryParam("RegionId") String region, @QueryParam("KeyPairName") String keyPairName); + + @Named("sshKeyPair:import") + @POST + @QueryParams(keys = "Action", values = "ImportKeyPair") + KeyPair importKeyPair(@QueryParam("RegionId") String region, + @QueryParam("PublicKeyBody") String publicKeyBody, + @QueryParam("KeyPairName") String keyPairName); + + @Named("sshKeyPair:delete") + @POST + @QueryParams(keys = "Action", values = "DeleteKeyPairs") + Request delete(@QueryParam("RegionId") String region); good point, this is useless. Removing -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#discussion_r203271177
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
andreaturli commented on this pull request. > + * 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.aliyun.ecs.domain; + +import com.google.common.base.MoreObjects; +import com.google.common.base.Objects; + +import java.beans.ConstructorProperties; + +import static com.google.common.base.Preconditions.checkNotNull; + +public class KeyPairRequest extends Request { https://github.com/google/auto/blob/master/value/userguide/howto.md#-have-one-autovalue-class-extend-another apparently we can't use `AutoValue` here -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#discussion_r203262402
Re: [jclouds/jclouds-labs] [JCLOUDS-1430] - add more features (#441)
andreaturli commented on this pull request. > + * 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.aliyun.ecs.domain; + +import com.google.common.base.MoreObjects; +import com.google.common.base.Objects; + +import java.beans.ConstructorProperties; + +import static com.google.common.base.Preconditions.checkNotNull; + +public class KeyPairRequest extends Request { I had this one in mind https://github.com/google/auto/issues/277 but maybe it's resolved since 1.3.0+ -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/441#discussion_r203162485