@@ -67,7 +67,7 @@ public static Attachment create(String hostedService,
String deployment, String
@Nullable public abstract String description();
/** The operating system type of the OS image, or null if a data disk. */
- @Nullable public abstract OSImage.Type os();
+
@@ -95,9 +95,9 @@ public static Attachment create(String hostedService,
String deployment, String
*/
@Nullable public abstract String sourceImage();
- public static Disk create(String name, String location, String
affinityGroup, String description, OSImage.Type os,
+
URI mediaLink, Integer logicalSizeInGB, Attachment attachedTo,
String sourceImage) {
- return new AutoValue_Disk(name, location, affinityGroup, description,
os, mediaLink, logicalSizeInGB, attachedTo,
+ return new AutoValue_Disk(name, location, affinityGroup,
@@ -37,7 +37,7 @@
public abstract String name();
/** The geo-locations of the image, if the image is not associated with
an affinity group. */
- public abstract ListString locations();
+ @Nullable public abstract String location();
Good spot!
Please make sure that all the
@@ -68,7 +68,7 @@ private void checkOSImage(OSImage OSImage) {
MediaLink should be an http(s) url + OSImage);
}
- assertTrue(locations.containsAll(OSImage.locations()), Locations not
in + locations + : + OSImage);
+ //
@@ -60,8 +60,8 @@ public void testList() {
}
private void checkDisk(Disk disk) {
- assertNull(disk.name(), Name cannot be null for: + disk);
- assertNull(disk.os(), OS cannot be null for: + disk);
+ assertNotNull(disk.name(), Name cannot be null for: + disk);
+
+
+ ImageBuilder builder = new ImageBuilder()
+.id(image.label())
+.name(image.name())
+.description(image.description())
+.status(Image.Status.AVAILABLE)
+.uri(image.mediaLink())
+
Thanks @hsbhathiya for your PR, very good start!
There are some comments from my side, please try to address them and if you
have troubles, feel free to reach out to us on IRC #jclouds.
---
Reply to this email directly or view it on GitHub:
Currently the options classes are not consistent.
This PR modifies `TargetHttpProxyOptions` and `TargetPoolCreationOptions`.
Are these improvements and should other Options classes be changed to this form?
You can merge this Pull Request by running:
git pull
+project xmlns=http://maven.apache.org/POM/4.0.0;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd;
+modelVersion4.0.0/modelVersion
+parent
+
+ * 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.profitbricks;
+ .defaultProperties(ProfitBricksApiMetadata.defaultProperties())
+ .defaultModules(ImmutableSet.Class? extends
Moduleof(ProfitBricksHttpApiModule.class));
+ }
+
+ @Override
+ public ProfitBricksApiMetadata build() {
+ return new
+ .defaultProperties(ProfitBricksApiMetadata.defaultProperties())
+ .defaultModules(ImmutableSet.Class? extends
Moduleof(ProfitBricksHttpApiModule.class));
+ }
+
+ @Override
+ public ProfitBricksApiMetadata build() {
+ return new
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static java.lang.String.format;
+
+import java.util.Map;
+
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.rest.MapBinder;
+
+import
+
+public abstract class BaseProfitBricksRequestBinderT implements MapBinder {
+
+ protected final StringBuilder requestBuilder;
+ protected String paramName;
+
+ public BaseProfitBricksRequestBinder() {
+ this.requestBuilder = new StringBuilder(255);
+ }
+
+ @Override
+
+import com.google.common.base.Strings;
+
+public abstract class BaseProfitBricksRequestBinderT implements MapBinder {
+
+ protected final StringBuilder requestBuilder;
+ protected String paramName;
+
+ public BaseProfitBricksRequestBinder() {
+ this.requestBuilder = new
+import static com.google.common.base.Preconditions.checkNotNull;
+import static java.lang.String.format;
+
+import java.util.Map;
+
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.rest.MapBinder;
+
+import com.google.common.base.Strings;
+ T payload = (T) obj;
+
+ return createRequest(request, createPayload(payload));
+ }
+
+ @Override
+ public R extends HttpRequest R bindToRequest(R request, Object input) {
+ throw new UnsupportedOperationException(Not supported yet.);
+ }
+
+ protected
+
+ checkNotNull(paramName, Initialize 'paramName' in constructor);
+ Object obj = checkNotNull(postParams.get(paramName), format(Param
'%s' cannot be null., paramName));
+ T payload = (T) obj;
+
+ return createRequest(request, createPayload(payload));
+ }
+
+
+ @Override
+ public R extends HttpRequest R bindToRequest(R request, Object input) {
+ throw new UnsupportedOperationException(Not supported yet.);
+ }
+
+ protected abstract String createPayload(T payload);
+
+ protected String ifNotEmpty(String pattern, Object param) {
+
+
+ protected String ifNotEmpty(String pattern, Object param) {
+ try {
+ return Strings.isNullOrEmpty((String) param) ? :
String.format(pattern, param);
+ } catch (ClassCastException ex) {
+ return Strings.isNullOrEmpty(param.toString()) ? :
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.MapBinder;
+import org.jclouds.rest.annotations.Payload;
+import org.jclouds.rest.annotations.PayloadParam;
+import org.jclouds.rest.annotations.RequestFilters;
+import
+* @return Returns a list of all Virtual Data Centers created by the
user, including ID, name and version number.
+*/
+ @POST
+ @Payload(ws:getAllDataCenters/)
+ @XMLResponseParser(DataCenterListResponseHandler.class)
+ @Fallback(Fallbacks.EmptyListOnNotFoundOr404.class)
+
+ /**
+* @param identifier Virtual Data Center identifier
+* @return Returns information about an existing virtual data center's
state and configuration.
+*/
+ @POST
+
@Payload(ws:getDataCenterdataCenterId{id}/dataCenterId/ws:getDataCenter)
+
+*/
+ @POST
+
@Payload(ws:clearDataCenterdataCenterId{id}/dataCenterId/ws:clearDataCenter)
+ @XMLResponseParser(DataCenterInfoResponseHandler.class)
+ DataCenter clearDataCenter(@PayloadParam(id) String identifier) throws
HttpResponseException;
+
+ /**
+* Deletes an
+import org.jclouds.rest.ResourceNotFoundException;
+
+/**
+ * Parse ProfitBricks API errors and set the appropriate exception.
+ */
+@Singleton
+public class ProfitBricksHttpErrorHandler implements HttpErrorHandler {
+
+ @Override
+ public void handleError(final HttpCommand command,
++ soapenv:Header/
++ soapenv:Body;
+
+ private final String SOAP_SUFFIX = /soapenv:Body/soapenv:Envelope;
+
+ @Override
+ public HttpRequest filter(HttpRequest request) throws HttpException {
+ checkNotNull(request.getPayload(), HTTP Request must contain payload
+ * 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
+ * limitations under the License.
+ */
+package org.jclouds.profitbricks.http.parser.datacenter;
+
+import javax.inject.Inject;
+
+import org.jclouds.date.DateCodecFactory;
+import org.jclouds.profitbricks.domain.DataCenter;
+import
+package org.jclouds.profitbricks.http.parser.datacenter;
+
+import org.jclouds.date.DateCodecFactory;
+import org.jclouds.profitbricks.domain.DataCenter;
+import org.jclouds.profitbricks.domain.Location;
+import org.jclouds.profitbricks.domain.ProvisioningState;
+import
+
+import org.jclouds.date.DateCodecFactory;
+import org.jclouds.profitbricks.domain.DataCenter;
+import org.jclouds.profitbricks.domain.Location;
+import org.jclouds.profitbricks.domain.ProvisioningState;
+import org.xml.sax.SAXException;
+
+import com.google.common.collect.Lists;
+ */
+package org.jclouds.profitbricks.http.parser.state;
+
+import org.jclouds.date.DateCodecFactory;
+import org.jclouds.profitbricks.domain.ProvisioningState;
+import org.jclouds.profitbricks.http.parser.BaseProfitBricksResponseHandler;
+import org.xml.sax.SAXException;
+
+import
+
+ DataCenter fetchedDc = api.getDataCenterApi().getDataCenter(dcId);
+
+ assertNotNull(fetchedDc);
+ assertEquals(newName, fetchedDc.name());
+ }
+
+ @Test(dependsOnMethods = testUpdateDataCenter)
+ public void testClearDataCenter() {
+ DataCenter dataCenter =
@devcsrj I've added the comments. The code looks very good, and you've followed
the advice of other PRs. Many thanks for that! :) This way we can set a good
base line so upcoming PRs are easier to review and to get merged.
Apart from the inline comments, there are a couple things missing that
Hmmm... In that case, if we are going to *keep* both forever, and now that we
have a custom Json adapter for the *entire* image object, wouldn't it be better
to remove the *complexMetadata* class, and promote the block device mapping
metadata as a root level element in the Image class? The
I'll have a deep look at this over the weekend. In general, access to VMs is
the main cause of Compute live test failures, and we need to make sure the
base compute live test class works out of the box, to be sure the compute
implementation meets the expected contract.
That said, configuring
Sounds good!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/116#issuecomment-67712167
So, this moves the mandatory fields to the options object itself. I like it, as
it is consistent (as long as we keep the mandatory parameter checks, which are
already present in the builders) and removes the need to have custom binders.
The simpler, the better. Thanks!
---
Reply to this email
Merged to master as
[b9d20f5](https://git-wip-us.apache.org/repos/asf?p=jclouds-labs-google.git;a=commit;h=b9d20f5b00f3cfb3857d179570f91daf75d8fd34).
Thanks!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/115#issuecomment-67713044
+1!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/68#issuecomment-67713226
@@ -208,10 +208,15 @@ public String putBlob(String container, Blob blob) {
@Override
public String putBlob(String container, Blob blob, PutOptions options) {
if (options.isMultipart()) {
- return multipartUploadStrategy.get().execute(container, blob);
+ String
You can merge this Pull Request by running:
git pull https://github.com/andrewgaul/jclouds azure-multipart-usermetadata
Or you can view, comment on it, or merge it online at:
https://github.com/jclouds/jclouds/pull/628
-- Commit Summary --
* JCLOUDS-391: Azure multipart putBlob user
Closed #422.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/422#event-210476074
@@ -208,10 +208,15 @@ public String putBlob(String container, Blob blob) {
@Override
public String putBlob(String container, Blob blob, PutOptions options) {
if (options.isMultipart()) {
- return multipartUploadStrategy.get().execute(container, blob);
+ String
[
https://issues.apache.org/jira/browse/JCLOUDS-391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14254406#comment-14254406
]
Andrew Gaul commented on JCLOUDS-391:
-
Reimplemented this the proper way with a live
[
https://issues.apache.org/jira/browse/JCLOUDS-391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrew Gaul reassigned JCLOUDS-391:
---
Assignee: Andrew Gaul
can't set user-defined metadata for Azure with multipart blobs
[
https://issues.apache.org/jira/browse/JCLOUDS-391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrew Gaul updated JCLOUDS-391:
Description:
Try to set user defined meta data for Azure blob storage. No error setting meta
[
https://issues.apache.org/jira/browse/JCLOUDS-391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrew Gaul updated JCLOUDS-391:
Description:
Try to set user defined meta data for Azure blob storage. No error setting meta
+ * 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
49 matches
Mail list logo