Closed #119.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/119#event-224541848
Pushed to master as
[3b6ddf0](https://git-wip-us.apache.org/repos/asf?p=jclouds-labs.git;a=commit;h=3b6ddf0d74bb7f4d5b7376b6e7f00b7336b139e8).
Thanks @devcsrj!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/119#issuecomment-71441228
Really nice test coverage @devcsrj. Thanks for the effort! Mind squashing the
commits so I can merge it?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/119#issuecomment-70999626
Hi @nacx . I addressed the comments and is now ready for another review cycle.
:)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/119#issuecomment-70445219
> @@ -56,6 +56,8 @@ protected BaseProfitBricksRequestBinder(String paramName) {
> protected abstract String createPayload(T payload);
>
> protected String formatIfNotEmpty(String pattern, Object param) {
> + if (param == null )
> + return "";
>return Strings.isNullOrE
> +import org.jclouds.rest.annotations.XMLResponseParser;
> +
> +@RequestFilters({BasicAuthentication.class,
> ProfitBricksSoapMessageEnvelope.class})
> +@Consumes(MediaType.TEXT_XML)
> +@Produces(MediaType.TEXT_XML)
> +public interface ImageApi {
> +
> + /**
> +* @return Outputs a list of a
> +
> + public abstract boolean isCpuHotPlug();
> +
> + public abstract boolean isCpuHotUnPlug();
> +
> + public abstract boolean isRamHotPlug();
> +
> + public abstract boolean isRamHotUnPlug();
> +
> + public abstract boolean isNicHotPlug();
> +
> + public abstract boolean isNicHotUnP
> +import org.jclouds.rest.annotations.Payload;
> +import org.jclouds.rest.annotations.PayloadParam;
> +import org.jclouds.rest.annotations.RequestFilters;
> +import org.jclouds.rest.annotations.XMLResponseParser;
> +
> +@RequestFilters( { BasicAuthentication.class,
> ProfitBricksSoapMessageEnvelo
Thanks! Most comments are minors.
Given [this
comment](https://github.com/jclouds/jclouds-labs/pull/119#discussion_r22944097),
though, I realized that the mock tests are not verifying that the requests we
generate have the expected body. This passed unnoticed in the previous review,
but we shou
> + try {
> + Image image = api.getImage(id);
> + assertRequestHasCommonProperties(server.takeRequest());
> + assertNotNull(image);
> + assertEquals(image.id(), id);
> + } finally {
> + pbApi.close();
> + server.shutdown();
> + }
> +
>
> + *
> + * 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
> +import org.jclouds.rest.annotations.XMLResponseParser;
> +
> +@RequestFilters({BasicAuthentication.class,
> ProfitBricksSoapMessageEnvelope.class})
> +@Consumes(MediaType.TEXT_XML)
> +@Produces(MediaType.TEXT_XML)
> +public interface ImageApi {
> +
> + /**
> +* @return Outputs a list of a
> +import org.jclouds.rest.annotations.Payload;
> +import org.jclouds.rest.annotations.PayloadParam;
> +import org.jclouds.rest.annotations.RequestFilters;
> +import org.jclouds.rest.annotations.XMLResponseParser;
> +
> +@RequestFilters( { BasicAuthentication.class,
> ProfitBricksSoapMessageEnvelo
> +return valueOf( v );
> + } catch ( IllegalArgumentException ex ) {
> +return UNRECOGNIZED;
> + }
> + }
> + }
> +
> + @Nullable
> + public abstract String id();
> +
> + @Nullable
> + @Override
> + public abstract String name();
> +
> + @N
> + @Nullable
> + public abstract AvailabilityZone availabilityZone();
> +
> + @Nullable
> + public abstract Date creationTime();
> +
> + @Nullable
> + public abstract Date lastModificationTime();
> +
> +// public abstract List storages();
> +// public abstract List storages();
> +
> +
> + public abstract boolean isCpuHotPlug();
> +
> + public abstract boolean isCpuHotUnPlug();
> +
> + public abstract boolean isRamHotPlug();
> +
> + public abstract boolean isRamHotUnPlug();
> +
> + public abstract boolean isNicHotPlug();
> +
> + public abstract boolean isNicHotUnP
> + HDD, CDROM, UNRECOGNIZED;
> +
> + public static Type fromValue(String v) {
> + try {
> +return valueOf(v);
> + } catch (IllegalArgumentException ex) {
> +return UNRECOGNIZED;
> + }
> + }
> + }
> +
> + public abstract String id()
> @@ -56,6 +56,8 @@ protected BaseProfitBricksRequestBinder(String paramName) {
> protected abstract String createPayload(T payload);
>
> protected String formatIfNotEmpty(String pattern, Object param) {
> + if (param == null )
> + return "";
>return Strings.isNullOrE
Hi! This PR is the implementation of ProfitBricks' API for:
* **Server** - [live test](https://gist.github.com/devcsrj/6a17a3c1347f740b0715)
* **Image** - [live test](https://gist.github.com/devcsrj/e4ab53864b75afa9655b)
As usual, looking forward to awesome code reviews!
You can merge this Pull R
19 matches
Mail list logo